Guest User

Untitled

a guest
Jul 11th, 2018
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 0.88 KB | None | 0 0
  1. new pNoReloadTimer[MAX_PLAYERS] = {-1, ...};
  2.  
  3. public OnPlayerDisconnect(playerid)
  4. {
  5.     if (pNoReloadTimer[playerid] != -1)
  6.     {
  7.         KillTimer(pNoReloadTimer[playerid]);
  8.         pNoReloadTimer[playerid] = -1;
  9.     }
  10.     return 1;
  11. }
  12.  
  13. CMD:noreload(playerid, params[])
  14. {
  15.     if (IsPlayerConnected(playerid))
  16.     {
  17.         if (PlayerInfo[playerid][pAdmin] >= 3)
  18.         {
  19.             if (pNoReloadTimer[playerid] != -1) SendClientMessage(playerid, COLOR_FAILED, "No reload mode already enabled!");
  20.             else
  21.             {
  22.                 pNoReloadTimer[playerid] = SetTimerEx("NoReload", 250, 1, "d", playerid);
  23.                 SendClientMessage(playerid, COLOR_SUCCESS, "No reload mode has been enabled!");
  24.             }
  25.         }
  26.         else SendClientMessage(playerid, COLOR_CORRECTION, "You are not authorized to use this command !");
  27.     }
  28. }
  29.  
  30. forward NoReload(playerid);
  31.  
  32. public NoReload(playerid)
  33. {
  34.     GivePlayerWeapon(playerid, GetPlayerWeapon(playerid), 10);
  35. }
Advertisement
Add Comment
Please, Sign In to add comment