Advertisement
DraKiNs

[FS] Server Locker

Jun 28th, 2011
283
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.42 KB | None | 0 0
  1. /*
  2.     Server Locker v1.0
  3.     by Crush
  4.     [iPs TeaM] | www.ips-team.blogspot.com |
  5. */
  6.  
  7. /*
  8.   @Creator: DraKiNs
  9.   @Project: ReturnParam
  10.  
  11.   @Date: 27/06/2011
  12.   @Site: www.ips-team.blogspot.com
  13. */
  14.  
  15. #define NULL        '\0'
  16. #define IsServerLocked  sSenha[0]
  17.  
  18. stock
  19.     sSenha[128] = NULL;
  20.  
  21. //===========  [ Commands ] =======================================
  22.  
  23. if(!strcmp(cmdtext, "/trancar", true, 8)) // 8 = lenght of /trancar
  24. {
  25.     if(!IsPlayerAdmin(playerid)) return false;
  26.     static
  27.         sStr[128]
  28.     ;
  29.     GetPlayerName(playerid, sStr, MAX_PLAYER_NAME);
  30.  
  31.     format(sStr, 128, "O admin %s[%i]:  acabou de trancar o servidor",sStr, playerid);
  32.     SendClientMessageToAll(0xFFFFFFFF, sStr);
  33.    
  34.     return sSenha = ReturnParam(cmdtext, 1), true;
  35. }
  36.  
  37. if(!strcmp(cmdtext, "/destrancar", true)) // 11 = lenght of /trancar
  38. {
  39.     static
  40.         sStr[128]
  41.     ;
  42.     GetPlayerName(playerid, sStr, MAX_PLAYER_NAME);
  43.  
  44.     format(sStr, 128, "%s[%i]:  acabou de destrancar o servidor",sStr, playerid);
  45.     SendClientMessageToAll(0xFFFFFFFF, sStr);  
  46.  
  47.     return sSenha[0] = NULL, true;
  48. }
  49.  
  50. //===========  [ Function ] =======================================
  51.  
  52. ReturnParam(cmdtext[], param)
  53. {
  54.     #if !defined MAX_STRING
  55.         #define MAX_STRING 128
  56.     #endif
  57.  
  58.     new
  59.         i,
  60.         spaces,
  61.         string[MAX_STRING],
  62.     ;
  63.     for( ; spaces != param; ++i)
  64.     {
  65.         if(!(cmdtext[i] == 0x20)) continue;
  66.         spaces++;
  67.     }
  68.     return strcat(string,cmdtext[i], MAX_STRING), cmdtext[i] = EOS, string;
  69. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement