Advertisement
Guest User

Untitled

a guest
Aug 12th, 2018
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.39 KB | None | 0 0
  1. CMD:setleader(playerid, params[]) // realizata de Dead
  2. {
  3. new userID, fID, id, skin, factionName[256], string[256];
  4. if(PlayerInfo[playerid][pAdmin] < 5) return NotAdmin(playerid);
  5. if(sscanf(params, "ui", userID, fID)) return SCM(playerid, COLOR_SERVER, "Syntax: {FFFFFF}/setleader <playerid> <faction id>");
  6. if(!IsPlayerConnected(userID)) return NotConnected(playerid);
  7. if(fID < 1 || fID > factions) {
  8. if(PlayerInfo[playerid][pLanguage] == 1) SCM(playerid, COLOR_GREY, "ID-ul factiunii este invalid.");
  9. else if(PlayerInfo[playerid][pLanguage] == 2) SCM(playerid, COLOR_GREY, "Faction ID is invalid.");
  10. return 1;
  11. }
  12. if(PlayerInfo[userID][pFaction] != 0) {
  13. if(PlayerInfo[playerid][pLanguage] == 1) SCM(playerid, COLOR_GREY, "Acel player face parte dintr-o factiune, foloseste /auninvite.");
  14. else if(PlayerInfo[playerid][pLanguage] == 2) SCM(playerid, COLOR_GREY, "That player is part of a faction, use the command /auninvite.");
  15. return 1;
  16. }
  17.  
  18. format(factionName, 256, FactionInfo[fID][fName]);
  19. PlayerInfo[userID][pFaction] = fID;
  20. PlayerInfo[userID][pLeader] = fID;
  21. PlayerInfo[userID][pRank] = 7;
  22. UpdateVariable(userID, pMemberx);
  23. UpdateVariable(userID, pFactionx);
  24. UpdateVariable(userID, pLeaderx);
  25. UpdateVariable(userID, pRankx);
  26. SetPlayerFactionColor(userID);
  27. SetPlayerSkin(playerid, PlayerInfo[playerid][pSkin]);
  28.  
  29.  
  30. if(PlayerInfo[id][pLeader] == 0) { SetPlayerSkin(playerid, 250); }
  31. else if(PlayerInfo[id][pLeader] == 1) { SetPlayerSkin(playerid, 265); } //Police Departament
  32. else if(PlayerInfo[id][pLeader] == 2) { SetPlayerSkin(playerid, 285); } //NG
  33. else if(PlayerInfo[id][pLeader] == 3) { SetPlayerSkin(playerid, 70);} // Paramedic
  34. else if(PlayerInfo[id][pLeader] == 4) { SetPlayerSkin(playerid, 272); } //Taxi
  35. else if(PlayerInfo[id][pLeader] == 5) { SetPlayerSkin(playerid, 123); } // NR
  36. else if(PlayerInfo[id][pLeader] == 6) { SetPlayerSkin(playerid, 294); } //Hitman
  37.  
  38. PlayerInfo[playerid][pSkin] = skin;
  39. UpdateVariable(playerid, pSkinx);
  40.  
  41. foreach(Player,i) {
  42. if(PlayerInfo[i][pLanguage] == 1 && PlayerInfo[i][pAdmin] >= 5 && Logs[i] == 1) {
  43. PlayerPlaySound(i, 1056, 0.0, 0.0, 0.0);
  44. format(string, sizeof(string), "AdmCmd: %s i-a setat lui %s lider la factiunea %s(%d).", GetName(playerid), GetName(userID), factionName, skin, fID);
  45. SCM(i, COLOR_LOGS, string);
  46. }
  47. else if(PlayerInfo[i][pLanguage] == 2 && PlayerInfo[i][pAdmin] >= 5 && Logs[i] == 1) {
  48. PlayerPlaySound(i, 1056, 0.0, 0.0, 0.0);
  49. format(string, sizeof(string), "AdmCmd: %s has set %s leader faction %s(%d).", GetName(playerid), GetName(userID), factionName, skin, fID);
  50. SCM(i, COLOR_LOGS, string);
  51. }
  52. }
  53. if(PlayerInfo[userID][pLanguage] == 1) {
  54. format(string, sizeof(string), "Felicitari! Ai primit lider la factiunea %s de la administratorul %s.", factionName, GetName(playerid));
  55. SCM(userID, COLOR_LIGHTBLUE, string);
  56. format(string, sizeof(string), "Pentru a vedea lista cu comenzile factiunii tale, foloseste comanda /help.");
  57. SCM(userID, COLOR_LIGHTBLUE, string);
  58. }
  59. else if(PlayerInfo[userID][pLanguage] == 2) {
  60. format(string, sizeof(string), "Congratulations! You got leader in faction %s by administrator %s.", factionName, GetName(playerid));
  61. SCM(userID, COLOR_LIGHTBLUE, string);
  62. format(string, sizeof(string), "To show your commands faction, use command /help.");
  63. SCM(userID, COLOR_LIGHTBLUE, string);
  64. }
  65. return 1;
  66. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement