FlacoBey

Untitled

Dec 29th, 2018
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.97 KB | None | 0 0
  1. new bool:CoolDown = false;
  2.  
  3. public OnMapStart()
  4. {
  5.     CreateTimer(15.0, CoolDown1, _, TIMER_FLAG_NO_MAPCHANGE);
  6. }
  7.  
  8. public OnPluginStart()
  9. {
  10.     AddCommandListener(CommandListener);
  11. }
  12.  
  13. public Action:CommandListener(client, const String:command[], args)
  14. {
  15.     if (StrEqual(command, "callvote", false))
  16.     {
  17.         new String:arg1[16];
  18.         GetCmdArg(1, arg1, sizeof(arg1));
  19.         if (StrEqual(arg1, "restartgame", false))
  20.         {
  21.             if(CoolDown == true)
  22.             {
  23.                 CoolDown = false;
  24.                 CreateTimer(15.0, CoolDown2, _, TIMER_REPEAT|TIMER_FLAG_NO_MAPCHANGE);
  25.                 return Plugin_Continue;
  26.             }
  27.             else
  28.             {
  29.                 CreateTimer(15.0, CoolDown3, _, TIMER_REPEAT|TIMER_FLAG_NO_MAPCHANGE);
  30.                 PrintToChatAll("Идёт кулдаун")
  31.                 return Plugin_Handled;
  32.             }
  33.         }
  34.     }
  35.     return Plugin_Continue;
  36. }
  37.  
  38. public Action CoolDown1(Handle timer)
  39. {
  40.     CoolDown = true;
  41. }
  42.  
  43. public Action CoolDown2(Handle timer)
  44. {
  45.     CoolDown = true;
  46. }
  47. public Action CoolDown3(Handle timer)
  48. {
  49.     CoolDown = true;
  50. }
Advertisement
Add Comment
Please, Sign In to add comment