Advertisement
Guest User

CMD:aname

a guest
Sep 20th, 2014
261
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.73 KB | None | 0 0
  1. CMD:akulah220(playerid, params[]) {
  2. if(PlayerInfo[playerid][pAdmin] > 1) {
  3. new
  4. userID,
  5. playerNameString[MAX_PLAYER_NAME];
  6.  
  7. if(sscanf(params, "us[24]", userID, playerNameString)) {
  8. return SendClientMessage(playerid, COLOR_GREY, "Tutor: /adminname [playerid] [adminname]");
  9. }
  10. else {
  11. if(!IsPlayerConnected(userID))
  12. return SendClientMessage(playerid, COLOR_GREY, "The specified player ID is either not connected or has not authenticated.");
  13.  
  14. if(PlayerInfo[userID][pAdmin] >= 1) {
  15. if(PlayerInfo[userID][pAdmin] > PlayerInfo[playerid][pAdmin]) {
  16. return SendClientMessage(playerid, COLOR_GREY, "You can't change the admin name of a higher level administrator.");
  17. }
  18. else {
  19. new
  20. messageString[128];
  21.  
  22. format(messageString, sizeof(messageString), "You have changed admin name to %s.", playerNameString);
  23. SendClientMessage(playerid, COLOR_WHITE, messageString);
  24.  
  25. format(messageString, sizeof(messageString), "changed your admin name to %s.", playerNameString);
  26. SendClientMessage(userID, COLOR_WHITE, messageString);
  27.  
  28. format(PlayerInfo[userID][pNamaAdmin], MAX_PLAYER_NAME, "%s", playerNameString);
  29.  
  30. if(AdminOnDuty[userID] >= 1)
  31. SetPlayerName(userID, playerNameString);
  32.  
  33. return 1;
  34. }
  35. }
  36. else {
  37. return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use that command!.");
  38. }
  39. }
  40. }
  41. return 1;
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement