ItsMods

Full Version: C++ Server Plugin API help
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi there,

I've been creating numerous plugins for my MW3 server, but there is something which i can't seem to figure out.

I'm trying to do an OnSay command so that when somebody says !fovincrease the FOV changes to e.g 80

if anyone can help with an example piece of code it would be appreciated.
C++ Code
  1. PLUGIN_API_ONSAY
  2. {
  3. string s = Message;
  4. if(s.substr(0, 12) == "!fovincrease")
  5. {
  6. SetClientDvar(Client->ClientNum, "cg_fov \"80\"");
  7. return CHAT_NONE;
  8. }
  9. return CHAT_ALL;
  10. }