garfield

[COD/FS]: Banimento permanente.

Oct 17th, 2011
604
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 0.99 KB | None | 0 0
  1. #include a_samp
  2.  
  3. new
  4.     bool:Olding[MAX_PLAYERS char]
  5. ;
  6.  
  7.  
  8.  
  9. public OnPlayerConnect(playerid)
  10. {
  11.     Olding{playerid} = false;
  12.    
  13.    
  14.     static Nome[28];
  15.     GetPlayerName(playerid, Nome, 24); strcat(Nome,".ips");
  16.     if(fexist(Nome))
  17.     {
  18.         Olding{playerid} = true;
  19.     }
  20.     return true;
  21. }
  22.  
  23.  
  24.  
  25. public OnPlayerSpawn(playerid)
  26. {
  27.     if(Olding[playerid] == true)
  28.     {
  29.         SetPlayerHealth(playerid, 0);
  30.         SendClientMessage(playerid, -1,"Você foi morto por que já foste banido.");
  31.         return 0;
  32.     }
  33.     return 1;
  34. }
  35.  
  36.  
  37.  
  38. public OnPlayerCommandText(playerid, cmdtext[])
  39. {
  40.     if(!strcmp(cmdtext,"/BAM", true))
  41.     {
  42.         permBan(playerid);
  43.         return 1;
  44.     }
  45.     return 0;
  46. }
  47.  
  48.  
  49. static stock permBan(playerid, motivo[] = "Sem Motivo aparente")
  50. {
  51.     if(IsPlayerConnected(playerid) && !IsPlayerAdmin(playerid))
  52.     {
  53.         static Nome[28], File: Suy;
  54.         GetPlayerName(playerid, Nome, 24); strcat(Nome,".ips");
  55.         Suy = fopen(Nome, io_write);
  56.         fwrite(Suy, motivo);
  57.         fclose(Suy);
  58.         BanEx(playerid, motivo);
  59.     }
  60.     return false;
  61. }
  62.  
Advertisement
Add Comment
Please, Sign In to add comment