Advertisement
Jakwob-WG

[Snippet] Ban Command

Oct 22nd, 2014
170
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 0.75 KB | None | 0 0
  1. enum PlayerInfo
  2. {
  3.     Banned,
  4. }
  5. new pInfo[MAX_PLAYERS][PlayerInfo];
  6.  
  7. public loadaccount_user(playerid, name[], value[])
  8. {
  9.     INI_Int("Banned",pInfo[playerid][Banned]);
  10.     return 1;
  11. }
  12.  
  13. public OnPlayerDisconnect(playerid, reason)
  14. {
  15.     new INI:file = INI_Open(Path(playerid));
  16.     INI_WriteInt(file,"Banned",pInfo[playerid][Banned]);
  17.     INI_Close(file);
  18.     return 1;
  19. }
  20.  
  21. ACMD:unban(playerid, params[])
  22. {
  23.     new targetid[MAX_PLAYER_NAME];
  24.     if(sscanf(params,"u",targetid)) return SCM(playerid,-1, "--- /unban {33CCFF}<ID/Name>{FFFFFF}---");
  25.    
  26.     new INI:file = INI_Open(targetid);
  27.     INI_SetTag(file, "Player's Data");
  28.     INI_WriteInt(file, "Banned", 0);
  29.     INI_Close(file);
  30.     SCM(playerid, -1, "You have unbanned that player");
  31.     return 1;
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement