Advertisement
Guest User

Untitled

a guest
Mar 29th, 2017
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.24 KB | None | 0 0
  1. public Plugin myinfo =
  2. {
  3. name = "FreeKill",
  4. author = "Wicked",
  5. description = "When someone thinks there freekilled it goes to chat if they do !freekill",
  6. version = "0.5",
  7. url = ""
  8. };
  9.  
  10. public void OnPluginStart()
  11. {
  12. RegConsoleCmd("sm_freekill", Command_freekill, "If they think they are freekilled it is said in chat");
  13. }
  14.  
  15. stock bool IsValidClient(int client, bool noBots=true)
  16. {
  17.  
  18. if (client < 1 || client > MaxClients)
  19. return false;
  20.  
  21. if (!IsClientInGame(client))
  22. return false;
  23.  
  24. if (!IsClientConnected(client))
  25. return false;
  26.  
  27. if (noBots)
  28. if (IsFakeClient(client))
  29. return false;
  30.  
  31. if (IsClientSourceTV(client))
  32. return false;
  33.  
  34. return true;
  35. }
  36.  
  37. public Action Command_freekill(client, args)
  38. {
  39. if(!IsValidClient(client))
  40. return Plugin_Handled
  41. if(GetTime() - g_iaTimes[client] < g_iCooldownTime ) {
  42.  
  43. g_iaTimes[client] = GetTime();
  44.  
  45. } else {
  46.  
  47. PrintToChat(client, PRG_CHAT_PREFIX ... "You're on cooldown!");
  48.  
  49. }
  50. int warden = ModularJail_GetWarden()
  51. LoopValidPlayers(i)
  52. {
  53. if(i || ModularJail_IsWarden(i))
  54. {
  55. PrintToChat(i, "%N Thinks he was Freekilled!", warden)
  56. }
  57. }
  58. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement