bgtracker

Untitled

Dec 3rd, 2014
278
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.25 KB | None | 0 0
  1. CMD:aduty(playerid, params[])
  2. {
  3. new string[128];
  4. if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
  5. if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");
  6. if(PlayerInfo[playerid][pDutyNameSet] == 0) return SendClientMessage(playerid, COLOR_GREY, "You don't have a duty name, please choose one by doing /adutyname");
  7. if(!aDuty[playerid])
  8. {
  9. format(string, sizeof(string), "AdmWarn: %s has went on admin duty.", RPN(playerid));
  10. SendClientMessageToAll(COLOR_YELLOW, string);
  11. aDuty[playerid] = 1;
  12. format(string, sizeof(string), "%s", RPALN(playerid));
  13. SetPlayerName(playerid, PlayerInfo[playerid][pDutyName]);
  14. }
  15. else
  16. {
  17. if(Spec[playerid]) return SendClientMessage(playerid, COLOR_GREY, "You can't go off admin duty while spectating someone.");
  18. aDuty[playerid] = 0;
  19. format(string, sizeof(string), "AdmWarn: %s has went off admin duty.", RPN(playerid));
  20. SendClientMessageToAll(COLOR_YELLOW, string);
  21. SetPlayerName(playerid, PlayerInfo[playerid][pOffDutyName]);
  22. SetPlayerHealth(playerid, 100);
  23. SetPlayerArmour(playerid, 100.0);
  24. }
  25. return 1;
  26. }
Advertisement
Add Comment
Please, Sign In to add comment