SHARE
TWEET

Untitled

a guest May 19th, 2017 45 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. #include <sourcemod>
  3. #include <cstrike>
  4. #include <autoexecconfig>
  5.  
  6.  
  7. Handle timerdelay[MAXPLAYERS+1];
  8. Handle timerinfini[MAXPLAYERS+1];
  9. Handle ammo;
  10.  
  11. bool possible[MAXPLAYERS+1]={true,...};
  12.  
  13. public void OnPluginStart()
  14. {
  15.     RegConsoleCmd("sm_recharge", infinirecharge);
  16.  
  17. }
  18.  
  19. public Action infinirecharge(int client, int args)
  20. {
  21.     if(!possible[client])
  22.         PrintToChat(client, "Cooldown non écoulé");  
  23.     else
  24.     {
  25.         ammo = FindConVar("sv_infinite_ammo");
  26.         SendConVarValue(client, ammo, "1");
  27.         timerinfini[client] = CreateTimer(1.0, timercompetence, client);
  28.         timerdelay[client] = CreateTimer(5.0, delay, client);
  29.     }
  30. }
  31.  
  32. public Action timercompetence(Handle timer, int client)
  33. {
  34.     possible[client]=true;
  35. }
  36.  
  37. public Action delay(Handle timer, int client)
  38. {
  39.     possible[client]=false;
  40.     ammo = FindConVar("sv_infinite_ammo");
  41.     SendConVarValue(client, ammo, "0");
  42.     PrintToChat(client, "fini");
  43. }
RAW Paste Data
Want to get better at C?
Learn to code C in 2017
Pastebin PRO Summer Special!
Get 40% OFF on Pastebin PRO accounts!
Top