Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CMD:setleader(playerid, params[]) // realizata de Dead
- {
- new userID, fID, id, skin, factionName[256], string[256];
- if(PlayerInfo[playerid][pAdmin] < 5) return NotAdmin(playerid);
- if(sscanf(params, "ui", userID, fID)) return SCM(playerid, COLOR_SERVER, "Syntax: {FFFFFF}/setleader <playerid> <faction id>");
- if(!IsPlayerConnected(userID)) return NotConnected(playerid);
- if(fID < 1 || fID > factions) {
- if(PlayerInfo[playerid][pLanguage] == 1) SCM(playerid, COLOR_GREY, "ID-ul factiunii este invalid.");
- else if(PlayerInfo[playerid][pLanguage] == 2) SCM(playerid, COLOR_GREY, "Faction ID is invalid.");
- return 1;
- }
- if(PlayerInfo[userID][pFaction] != 0) {
- if(PlayerInfo[playerid][pLanguage] == 1) SCM(playerid, COLOR_GREY, "Acel player face parte dintr-o factiune, foloseste /auninvite.");
- else if(PlayerInfo[playerid][pLanguage] == 2) SCM(playerid, COLOR_GREY, "That player is part of a faction, use the command /auninvite.");
- return 1;
- }
- format(factionName, 256, FactionInfo[fID][fName]);
- PlayerInfo[userID][pFaction] = fID;
- PlayerInfo[userID][pLeader] = fID;
- PlayerInfo[userID][pRank] = 7;
- UpdateVariable(userID, pMemberx);
- UpdateVariable(userID, pFactionx);
- UpdateVariable(userID, pLeaderx);
- UpdateVariable(userID, pRankx);
- SetPlayerFactionColor(userID);
- SetPlayerSkin(playerid, PlayerInfo[playerid][pSkin]);
- if(PlayerInfo[id][pLeader] == 0) { SetPlayerSkin(playerid, 250); }
- else if(PlayerInfo[id][pLeader] == 1) { SetPlayerSkin(playerid, 265); } //Police Departament
- else if(PlayerInfo[id][pLeader] == 2) { SetPlayerSkin(playerid, 285); } //NG
- else if(PlayerInfo[id][pLeader] == 3) { SetPlayerSkin(playerid, 70);} // Paramedic
- else if(PlayerInfo[id][pLeader] == 4) { SetPlayerSkin(playerid, 272); } //Taxi
- else if(PlayerInfo[id][pLeader] == 5) { SetPlayerSkin(playerid, 123); } // NR
- else if(PlayerInfo[id][pLeader] == 6) { SetPlayerSkin(playerid, 294); } //Hitman
- PlayerInfo[playerid][pSkin] = skin;
- UpdateVariable(playerid, pSkinx);
- foreach(Player,i) {
- if(PlayerInfo[i][pLanguage] == 1 && PlayerInfo[i][pAdmin] >= 5 && Logs[i] == 1) {
- PlayerPlaySound(i, 1056, 0.0, 0.0, 0.0);
- format(string, sizeof(string), "AdmCmd: %s i-a setat lui %s lider la factiunea %s(%d).", GetName(playerid), GetName(userID), factionName, skin, fID);
- SCM(i, COLOR_LOGS, string);
- }
- else if(PlayerInfo[i][pLanguage] == 2 && PlayerInfo[i][pAdmin] >= 5 && Logs[i] == 1) {
- PlayerPlaySound(i, 1056, 0.0, 0.0, 0.0);
- format(string, sizeof(string), "AdmCmd: %s has set %s leader faction %s(%d).", GetName(playerid), GetName(userID), factionName, skin, fID);
- SCM(i, COLOR_LOGS, string);
- }
- }
- if(PlayerInfo[userID][pLanguage] == 1) {
- format(string, sizeof(string), "Felicitari! Ai primit lider la factiunea %s de la administratorul %s.", factionName, GetName(playerid));
- SCM(userID, COLOR_LIGHTBLUE, string);
- format(string, sizeof(string), "Pentru a vedea lista cu comenzile factiunii tale, foloseste comanda /help.");
- SCM(userID, COLOR_LIGHTBLUE, string);
- }
- else if(PlayerInfo[userID][pLanguage] == 2) {
- format(string, sizeof(string), "Congratulations! You got leader in faction %s by administrator %s.", factionName, GetName(playerid));
- SCM(userID, COLOR_LIGHTBLUE, string);
- format(string, sizeof(string), "To show your commands faction, use command /help.");
- SCM(userID, COLOR_LIGHTBLUE, string);
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement