Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- YCMD:setleader(playerid, params[], help) {
- if(PlayerInfo[playerid][pAdmin] < 4) return SCM(playerid, COLOR_WHITE, AdminOnly);
- new id,level,string[180];
- if(sscanf(params, "ui",id,level)) return SCM(playerid, COLOR_GREY, "USAGE: {FFFFFF}/setleader <playerid/name> <faction>");
- if(!IsPlayerConnected(id) || id == INVALID_PLAYER_ID) return SCM(playerid, COLOR_GREY, "Acel player nu este conectat.");
- if(level > 15 || level < 0) return SCM(playerid, COLOR_WHITE, "Invalid ID. (1-15).");
- if(PlayerInfo[id][pMember] > 0 && PlayerInfo[id][pLeader] > 0) return SCM(playerid,COLOR_WHITE, "Acel player este intr-o factiune.");
- format(string, sizeof(string), "%s este noul lider al factiunii.", GetName(id));
- SendFactionMessage(level, COLOR_CLIENT, string);
- new ftext[50];
- format(ftext, sizeof(ftext), FactionName(level));
- PlayerInfo[id][pMember] = level;
- if(PlayerInfo[playerid][pMember] == 11) finishAchievement(id, 29);
- else if(IsACop(playerid)) finishAchievement(id, 30);
- else if(IsAMember(playerid)) finishAchievement(id, 31);
- else finishAchievement(id, 28);
- PlayerInfo[id][pLeader] = level;
- FactionMembers[PlayerInfo[id][pMember]] ++;
- if(level == 0) { PlayerInfo[id][pChar] = 0; }
- else if(level == 1 || level == 14) { PlayerInfo[id][pChar] = 265; } //Police Departament
- else if(level == 2) { PlayerInfo[id][pChar] = 295; } //FBI
- else if(level == 3) { PlayerInfo[id][pChar] = 179; } //National Guard
- else if(level == 4) { PlayerInfo[id][pChar] = 270; } //Triad
- else if(level == 5) { PlayerInfo[id][pChar] = 292; } //Los Vagos
- else if(level == 6) { PlayerInfo[id][pChar] = 273; } //Ballas
- else if(level == 7) { PlayerInfo[id][pChar] = 258; } //School Instructors
- else if(level == 8) { PlayerInfo[id][pChar] = 59; } //Tow Car Company
- else if(level == 9) { PlayerInfo[id][pChar] = 228; } //News Reporters
- else if(level == 10) { PlayerInfo[id][pChar] = 296; } //Los Aztecas
- else if(level == 11) { PlayerInfo[id][pChar] = 294; } //Hitman
- else if(level == 12) { PlayerInfo[id][pChar] = 272; } //Taxi
- else if(level == 13) { PlayerInfo[id][pChar] = 70; } //Paramedic
- else if(level == 15) { PlayerInfo[id][pChar] = 272; } // Factiunea noua
- if(IsACop(id)) SetPlayerSkinEx(id, 305);
- else SetPlayerSkinEx(id, PlayerInfo[id][pChar]);
- PlayerInfo[id][pRank] = 7;
- SetPlayerToTeamColor(id);
- new query[256];
- format(string, sizeof(string), "%s este liderul factiunii %s.", GetName(id), ftext);
- if(PlayerInfo[id][pAdmin] < 6) {
- mysql_format(SQL, query, sizeof(query), "INSERT INTO faction_logs (`text`, `player`,`leader`) VALUES ('%s','%d','%d')", string, PlayerInfo[id][pSQLID],PlayerInfo[playerid][pSQLID]);
- mysql_tquery(SQL,query,"","");
- }
- 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]);
- mysql_query(SQL,query);
- format(string, sizeof(string), "L-ai promovat pe %s ca lider la factiunea %s.", GetName(id),ftext);
- SCM(playerid, COLOR_LIGHTBLUE, string);
- format(string, sizeof(string), "Admin %s te-a promovat ca lider al factiunii %s.", GetName(playerid),ftext);
- SCM(id, COLOR_LIGHTBLUE, string);
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement