Advertisement
Stewox

Set Client Cvar

May 10th, 2011
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.06 KB | None | 0 0
  1. //This was my idea when i started to get used to scripting:
  2. //this is just the core of it , else stuff it cut out (settings and other syntax , because it's a part of larger file with many differen stuff )
  3.  
  4. ......
  5.  
  6.         if(getCvar("mm_setclientcmd") != "")
  7.         {
  8.             level._cmd = getcvar("mm_setclientcmd");
  9.         }
  10.        
  11.         if(getCvar("mm_execlientcmd") != "")
  12.         {
  13.             PlayerID = getcvarint("mm_execlientcmd");
  14.             players = getentarray("player", "classname");
  15.             for (playernum = 0; playernum < players.size; playernum++)
  16.             {
  17.                 player = players[playernum];
  18.                 entID = player getEntityNumber();
  19.  
  20.                 if ( ( entID == PlayerID ))
  21.                 {
  22.                     player SetClientCommand(); //exectutes another part of code
  23.                     player thread SetClientCommand();
  24.                     wait 1;
  25.                 }
  26.             }
  27.         }
  28. .....
  29.  
  30.  
  31. //this code makes possible to choose any console command , customize it's value and apply to a specific player ingame, which made some quite interesting results, primarly used as a punish system for cheaters, making their game go crazys and then at the end , crash their game application
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement