06.04.2014, 06:33
Код:
CMD:makeleader(playerid, params[]) { if (PlayerInfo[playerid][pAdmin] >= 1337) { new string[128], giveplayerid, faction; if(sscanf(params, "ud", giveplayerid, faction)) { SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /makeleader [playerid] [factionid]"); SendClientMessageEx(playerid, COLOR_GRAD3, "0 Normal Civilian |1 LSPD |2 FBI |3 SFPD |4 LSFMD |5 Judicial System"); SendClientMessageEx(playerid, COLOR_GRAD2, "|6 Government |7 SASD |8 Hitman |9 SA News"); SendClientMessageEx(playerid, COLOR_GRAD1, "|10 Taxi Company |11 SANG |12 Tierra Robada"); SendClientMessageEx(playerid, COLOR_GRAD1, "|13 NOOSE |14 Al' Qaeda"); return 1; } if(PlayerInfo[giveplayerid][pLeader] == 0) return SendClientMessageEx(playerid, 0xFF0000FF,"That player doesnt have any faction!"); if(faction > 14 || faction < 0) { SendClientMessageEx(playerid, COLOR_GREY, " Don't go below number 0, or above number 13!"); return 1; } if(IsPlayerConnected(giveplayerid)) { new ftext[30]; PlayerInfo[giveplayerid][pLeader] = faction; PlayerInfo[giveplayerid][pRank] = 6; PlayerInfo[giveplayerid][pMember] = faction; if(PlayerInfo[giveplayerid][pLeader] == 0) { ftext = "Normal Civilian"; } else if(PlayerInfo[giveplayerid][pLeader] == 1) { ftext = "LSPD"; } else if(PlayerInfo[giveplayerid][pLeader] == 2) { ftext = "FBI"; } else if(PlayerInfo[giveplayerid][pLeader] == 3) { ftext = "SFPD"; } else if(PlayerInfo[giveplayerid][pLeader] == 4) { ftext = "LSFMD"; } else if(PlayerInfo[giveplayerid][pLeader] == 5) { ftext = "Judicial System"; } else if(PlayerInfo[giveplayerid][pLeader] == 6) { ftext = "The Government"; } else if(PlayerInfo[giveplayerid][pLeader] == 7) { ftext = "SASD"; } else if(PlayerInfo[giveplayerid][pLeader] == 8) { ftext = "Hitman Agency"; } else if(PlayerInfo[giveplayerid][pLeader] == 9) { ftext = "SA News"; } else if(PlayerInfo[giveplayerid][pLeader] == 10) { ftext = "Taxi Cab Company"; } else if(PlayerInfo[giveplayerid][pLeader] == 11) { ftext = "San Andreas National Guard"; } else if(PlayerInfo[giveplayerid][pLeader] == 12) { ftext = "Tierra Robada"; } else if(PlayerInfo[giveplayerid][pLeader] == 13) { ftext = "NOOSE"; } else if(PlayerInfo[giveplayerid][pLeader] == 14) {ftext = "Al' Qaeda"; } else { return 1; } new kickinfo[128]; new receivekickinfo[128]; format(kickinfo, sizeof(kickinfo), "You have kicked %s for being a leader of %s.", GetPlayerNameEx(giveplayerid), ftext); format(receivekickinfo, sizeof(receivekickinfo), "You have been kicked for being leader of %s by Adminstrator %s", ftext, GetPlayerNameEx(playerid)); format(string, sizeof(string), "You have been made the leader of the %s by Administrator %s.",ftext, GetPlayerNameEx(playerid)); if(PlayerInfo[giveplayerid][pLeader] == 0) { SendClientMessageEx(giveplayerid, COLOR_LIGHTBLUE, receivekickinfo); SendClientMessageEx(playerid, COLOR_LIGHTBLUE, kickinfo); } else { format(string, sizeof(string), "You have made %s the leader of the %s.", GetPlayerNameEx(giveplayerid),ftext); SendClientMessageEx(giveplayerid, COLOR_LIGHTBLUE, string); SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string); } if(faction < 4 && faction > 0 || faction > 4 && faction < 7) { gTeam[giveplayerid] = 2; PlayerInfo[giveplayerid][pTeam] = 2; } PlayerInfo[giveplayerid][pFMember] = 255; } } else { SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command!"); } return 1; }