Advertisement
Guest User

Untitled

a guest
Mar 12th, 2019
186
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.24 KB | None | 0 0
  1. YCMD:setleader(playerid, params[], help) {
  2. if(PlayerInfo[playerid][pAdmin] < 4) return SCM(playerid, COLOR_WHITE, AdminOnly);
  3. new id,level,string[180];
  4. if(sscanf(params, "ui",id,level)) return SCM(playerid, COLOR_GREY, "USAGE: {FFFFFF}/setleader <playerid/name> <faction>");
  5. if(!IsPlayerConnected(id) || id == INVALID_PLAYER_ID) return SCM(playerid, COLOR_GREY, "Acel player nu este conectat.");
  6. if(level > 15 || level < 0) return SCM(playerid, COLOR_WHITE, "Invalid ID. (1-15).");
  7.  
  8. if(PlayerInfo[id][pMember] > 0 && PlayerInfo[id][pLeader] > 0) return SCM(playerid,COLOR_WHITE, "Acel player este intr-o factiune.");
  9. format(string, sizeof(string), "%s este noul lider al factiunii.", GetName(id));
  10. SendFactionMessage(level, COLOR_CLIENT, string);
  11.  
  12. new ftext[50];
  13. format(ftext, sizeof(ftext), FactionName(level));
  14. PlayerInfo[id][pMember] = level;
  15.  
  16. if(PlayerInfo[playerid][pMember] == 11) finishAchievement(id, 29);
  17. else if(IsACop(playerid)) finishAchievement(id, 30);
  18. else if(IsAMember(playerid)) finishAchievement(id, 31);
  19. else finishAchievement(id, 28);
  20.  
  21.  
  22. PlayerInfo[id][pLeader] = level;
  23. FactionMembers[PlayerInfo[id][pMember]] ++;
  24. if(level == 0) { PlayerInfo[id][pChar] = 0; }
  25. else if(level == 1 || level == 14) { PlayerInfo[id][pChar] = 265; } //Police Departament
  26. else if(level == 2) { PlayerInfo[id][pChar] = 295; } //FBI
  27. else if(level == 3) { PlayerInfo[id][pChar] = 179; } //National Guard
  28. else if(level == 4) { PlayerInfo[id][pChar] = 270; } //Triad
  29. else if(level == 5) { PlayerInfo[id][pChar] = 292; } //Los Vagos
  30. else if(level == 6) { PlayerInfo[id][pChar] = 273; } //Ballas
  31. else if(level == 7) { PlayerInfo[id][pChar] = 258; } //School Instructors
  32. else if(level == 8) { PlayerInfo[id][pChar] = 59; } //Tow Car Company
  33. else if(level == 9) { PlayerInfo[id][pChar] = 228; } //News Reporters
  34. else if(level == 10) { PlayerInfo[id][pChar] = 296; } //Los Aztecas
  35. else if(level == 11) { PlayerInfo[id][pChar] = 294; } //Hitman
  36. else if(level == 12) { PlayerInfo[id][pChar] = 272; } //Taxi
  37. else if(level == 13) { PlayerInfo[id][pChar] = 70; } //Paramedic
  38. else if(level == 15) { PlayerInfo[id][pChar] = 272; } // Factiunea noua
  39. if(IsACop(id)) SetPlayerSkinEx(id, 305);
  40. else SetPlayerSkinEx(id, PlayerInfo[id][pChar]);
  41. PlayerInfo[id][pRank] = 7;
  42. SetPlayerToTeamColor(id);
  43.  
  44. new query[256];
  45. format(string, sizeof(string), "%s este liderul factiunii %s.", GetName(id), ftext);
  46.  
  47. if(PlayerInfo[id][pAdmin] < 6) {
  48. mysql_format(SQL, query, sizeof(query), "INSERT INTO faction_logs (`text`, `player`,`leader`) VALUES ('%s','%d','%d')", string, PlayerInfo[id][pSQLID],PlayerInfo[playerid][pSQLID]);
  49. mysql_tquery(SQL,query,"","");
  50. }
  51.  
  52. format(query,sizeof(query),"UPDATE users SET `Leader`='%d',`Member`='%d',`Rank`='7',`Team`='%d',`CChar`='%d' WHERE `ID`='%d'",PlayerInfo[id][pLeader],PlayerInfo[id][pMember],PlayerInfo[id][pTeam],PlayerInfo[id][pChar],PlayerInfo[id][pSQLID]);
  53. mysql_query(SQL,query);
  54. format(string, sizeof(string), "L-ai promovat pe %s ca lider la factiunea %s.", GetName(id),ftext);
  55. SCM(playerid, COLOR_LIGHTBLUE, string);
  56.  
  57. format(string, sizeof(string), "Admin %s te-a promovat ca lider al factiunii %s.", GetName(playerid),ftext);
  58. SCM(id, COLOR_LIGHTBLUE, string);
  59. return 1;
  60. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement