Advertisement
Blackevils

Untitled

Apr 27th, 2020
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.61 KB | None | 0 0
  1. CMD:setrank(playerid,params[])
  2. {
  3. if(PlayerInfo[playerid][Gangid] == 0) return SendClientMessage(playerid, 0xff0000ff, "ERROR: You must be in a gang for use this command.");
  4. //if(PlayerInfo[playerid][Gangrank] <= 2) return SendClientMessage(playerid, 0xff0000ff, "ERROR: Your need Co-Leader rank in gang for use this command.");
  5. if(sscanf(params, "u", ids)) return SendClientMessage(playerid, -1, "{FF0000}USAGE: {FFFFFF}/Setrank [playerid]");
  6. if(!IsPlayerConnected(ids)) return SendClientMessage(playerid, -1, "{FF0000}ERROR: {FFFFFF}That player isn't connected.");
  7. //if(PlayerInfo[playerid][Gangrank] <= PlayerInfo[ID][Gangrank]) return SendClientMessage(playerid, 0xff0000ff, "ERROR: You can't change this player rank.");
  8. //ids = ID ;
  9. ShowPlayerDialog(playerid,DIALOG_GRANK,DIALOG_STYLE_LIST, "Set gang rank", "Member\nCo-leader\nLeader\nCo-Owner\nOwner\n{FF0000}Founder", "Select", "Close");
  10. return 1;
  11. }
  12.  
  13. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  14. {
  15. if(dialogid == DIALOG_GRANK)
  16. {
  17. if(response)
  18. {
  19. if(listitem == 0)
  20. {
  21. PlayerInfo[ids][Gangrank] =1;
  22. }
  23. if(listitem == 1)
  24. {
  25. PlayerInfo[ids][Gangrank] =2;
  26. }
  27. if(listitem == 2)
  28. {
  29. PlayerInfo[ids][Gangrank] =3;
  30. }
  31. if(listitem == 3)
  32. {
  33. PlayerInfo[ids][Gangrank] =4;
  34. }
  35. if(listitem == 4)
  36. {
  37. PlayerInfo[ids][Gangrank] =5;
  38. }
  39. if(listitem == 5)
  40. {
  41. if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "{FF0000}ERROR: {FFFFFF}You are not authorized to set this rank.");
  42. PlayerInfo[ids][Gangrank] =6;
  43. }
  44. }
  45. }
  46. return 1;
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement