Advertisement
Guest User

No Rcon Lock Server

a guest
May 28th, 2014
537
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.31 KB | None | 0 0
  1. #include <a_samp>
  2.  
  3. #if defined FILTERSCRIPT
  4.  
  5. new ServerLocked;
  6.  
  7. public OnFilterScriptInit()
  8. {
  9.     ServerLocked = 0;
  10.     return 1;
  11. }
  12.  
  13. public OnFilterScriptExit()
  14. {
  15.     return 1;
  16. }
  17.  
  18. public OnPlayerRequestClass(playerid, classid)
  19. {
  20.     if(ServerLocked == 1) return SendClientMessage(playerid, -1, "You Cannot Join The Server Because It Is Locked!!!");
  21.     else if(ServerLocked == 0) return SpawnPlayer(playerid);
  22.     return 1;
  23. }
  24.  
  25. public OnPlayerCommandText(playerid, cmdtext[])
  26. {
  27.     if (strcmp("/lockserver", cmdtext, true, 10) == 0)
  28.     {
  29.         if(IsPlayerConnected(playerid)) return SendClientMessage(playerid, -1, "You are not connected to the server");
  30.         if(IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "You have just locked the server - SERVER LOCKED"); SendClientMessageToAll(-1, "SERVER STATUS: The server has been locked"); ServerLocked = 1;
  31.         return 1;
  32.     }
  33.     if (strcmp("/unlockserver", cmdtext, true, 10) == 0)
  34.     {
  35.         if(IsPlayerConnected(playerid)) return SendClientMessage(playerid, -1, "You are not connected to the server");
  36.         if(IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "You have just unlocked the server - SERVER UNLOCKED"); SendClientMessageToAll(-1, "SERVER STATUS: The server has been unlocked"); ServerLocked = 1;
  37.         return 1;
  38.     }
  39.     return 0;
  40. }
  41.  
  42.  
  43. #else
  44.  
  45. main() { }
  46.  
  47. #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement