Advertisement
Guest User

SA-MP Filterscript; Server Lock System - No Rcon

a guest
Jun 24th, 2014
370
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <a_samp>
  2. #include <YSI\y_commands>
  3.  
  4. forward KickT(playerid);
  5.  
  6. new ServerLocked;
  7. new PlayerAdmin[MAX_PLAYERS];
  8.  
  9. #if defined FILTERSCRIPT
  10.  
  11. public OnFilterScriptInit()
  12. {
  13. ServerLocked = 0;
  14. return 1;
  15. }
  16.  
  17. public OnFilterScriptExit()
  18. {
  19. return 1;
  20. }
  21.  
  22. #else
  23.  
  24. main()
  25. {
  26. print("\n----------------------------------");
  27. print(" Server Lock System By Ciandlah");
  28. print("----------------------------------\n");
  29. }
  30.  
  31. #endif
  32.  
  33. public OnPlayerConnect(playerid)
  34. {
  35. PlayerAdmin[playerid] = 0;
  36. return 1;
  37. }
  38.  
  39. public OnPlayerRequestClass(playerid)
  40. {
  41. if(ServerLocked == 1)
  42. {
  43. SendClientMessage(playerid, -1, "Server Note: The server has been locked and therfore it has kicked you.");
  44. SetTimerEx("KickT", 1000, playerid, "i", false);
  45. }
  46. return 1;
  47. }
  48.  
  49. public KickT(playerid)
  50. {
  51. Kick(playerid);
  52. return 1;
  53. }
  54.  
  55. CMD:setadmin(playerid, params[])
  56. {
  57. if(IsPlayerConnected(playerid))
  58. {
  59. if(PlayerAdmin[playerid] == 0)
  60. {
  61. PlayerAdmin[playerid] = 1;
  62. }
  63. else
  64. {
  65. PlayerAdmin[playerid] = 0;
  66. }
  67. }
  68. return 1;
  69. }
  70.  
  71. CMD:lock(playerid, params[])
  72. {
  73. if(IsPlayerConnected(playerid))
  74. {
  75. if(PlayerAdmin[playerid] == 1)
  76. {
  77. if(ServerLocked == 0)
  78. {
  79. ServerLocked = 1;
  80. }
  81. else
  82. {
  83. ServerLocked = 0;
  84. }
  85. }
  86. }
  87. return 1;
  88. }
Advertisement
Advertisement
Advertisement
RAW Paste Data Copied
Advertisement