Advertisement
Hyland

[CMD] deleteaccount

Dec 21st, 2014
155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1. if(strcmp(cmd, "/deleteaccount", true)==0)
  2. {
  3. if(PlayerInfo[playerid][pAdmin] >= 1337)
  4. {
  5. tmp = strtok(cmdtext, idx);
  6. if(!strlen(tmp))
  7. {
  8. SendClientMessage(playerid, COLOR_WHITE, "USAGE: /deleteaccount [name]");
  9. return 1;
  10. }
  11. strmid(sendername, PlayerRPName(playerid), 0, MAX_PLAYER_NAME);
  12. format(string,sizeof(string),"%s.ini",tmp);
  13. if(dini_Int(string, "AdminLvl") > PlayerInfo[playerid][pAdmin])
  14. {
  15. SendClientMessage(playerid, COLOR_GREY, "You can't delete accounts of higher level Admins !");
  16. return 1;
  17. }
  18. if(fexist(string))
  19. {
  20. fremove(string);
  21. format(string, sizeof(string), "{FF0000}AdmWarning{FFFFFF}: %s was deleted by %s.", tmp, sendername);
  22. ABroadCast(COLOR_WHITE,string,1);
  23. }
  24. else
  25. {
  26. SendClientMessage(playerid, COLOR_GRAD2, " That account doesn't exist.");
  27. }
  28.  
  29. }
  30. else
  31. {
  32. SendClientMessage(playerid, COLOR_GRAD2, " You are not authorized to use this command.");
  33. }
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement