29.04.2012, 09:12
So when I give leader to someone, ex leader should be kicked form that organisation. For example: "John is the leader of FBI. He is away for long time and I want to find new leader. Now I gave the leader to Dom. What I want is that John gets kicked from organisation".. I think it is not big deal to make but I don't know how. Please help!
Post Scriptum: Sry for my bad English
Post Scriptum: Sry for my bad English
Код:
if(strcmp(cmd, "/makeleader", true) == 0) { if(IsPlayerConnected(playerid)) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_GRAD2, "Koristite: /makeleader [playerid/PartOfName] [Number(1-15)]"); return 1; } new para1; new level; para1 = ReturnUser(tmp); tmp = strtok(cmdtext, idx); level = strval(tmp); if(level > 16 || level < 0) { SendClientMessage(playerid, COLOR_GREY, " Ne idite ispod 0, ili iznad 16!"); return 1; } if (PlayerInfo[playerid][pAdmin] >= 4) { if(IsPlayerConnected(para1)) { if(para1 != INVALID_PLAYER_ID) { if(PlayerInfo[para1][pMember] > 0 || PlayerInfo[para1][pFMember] < 255) { SendClientMessage(playerid, COLOR_GREY, " Taj igrac je u Faction / Family !"); return 1; } GetPlayerName(para1, giveplayer, sizeof(giveplayer)); GetPlayerName(playerid, sendername, sizeof(sendername)); PlayerInfo[para1][pLeader] = level; format(string, sizeof(string), " promovisani ste za lidera zbog vaseg zahteva za Faction od strane OSCa %s", sendername); SendClientMessage(para1, COLOR_WHITE, string); format(string, sizeof(string), " Dali ste igracu %s da bira Faction broj %d.", giveplayer,level); SendClientMessage(playerid, COLOR_WHITE, string); if(level == 0) { PlayerInfo[para1][pChar] = 0; PlayerInfo[para1][pRank] = 0; gTeam[para1] = 3; PlayerInfo[para1][pTeam] = 0; return 1; } else if(level == 1) { SetPlayerColor(para1, COLOR_BLUE); PlayerInfo[para1][pChar] = 288; } //MILICIJA-PD else if(level == 2) { SetPlayerColor(para1, COLOR_BLUE); PlayerInfo[para1][pChar] = 286; } //BIA-FBI else if(level == 3) { SetPlayerColor(para1, COLOR_BLUE); PlayerInfo[para1][pChar] = 287; } //National Guard else if(level == 4) { SetPlayerColor(para1, COLOR_WHITE); PlayerInfo[para1][pChar] = 70; } //Bolnicari-Medic else if(level == 5) { SetPlayerColor(para1, COLOR_WHITE); PlayerInfo[para1][pChar] = 116; } //Surenos else if(level == 6) { SetPlayerColor(para1, COLOR_WHITE); PlayerInfo[para1][pChar] = 125; } //La Cosa Nostra else if(level == 7) { SetPlayerColor(para1, COLOR_WHITE); PlayerInfo[para1][pChar] = 147; } //Gradonacelnik-Major else if(level == 8) { SetPlayerColor(para1, COLOR_WHITE); PlayerInfo[para1][pChar] = 249; } //Hitmans else if(level == 9) { SetPlayerColor(para1, COLOR_WHITE); PlayerInfo[para1][pChar] = 227; } //Novinari-CBS else if(level == 10) { SetPlayerColor(para1, COLOR_WHITE); PlayerInfo[para1][pChar] = 61; } //Taxi Cab Company else if(level == 11) { SetPlayerColor(para1, COLOR_WHITE); PlayerInfo[para1][pChar] = 124; } //LCN else if(level == 12) { SetPlayerColor(para1, COLOR_WHITE); PlayerInfo[para1][pChar] = 176; } //Yamaguchi else if(level == 13) { SetPlayerColor(para1, COLOR_WHITE); PlayerInfo[para1][pChar] = 296; } //Ballas else if(level == 14) { SetPlayerColor(para1, COLOR_WHITE); PlayerInfo[para1][pChar] = 108; } //Ms 13 Mara Salvatrucha else if(level == 15) { SetPlayerColor(para1, COLOR_WHITE); PlayerInfo[para1][pChar] = 271; } //GroveStreet Families else if(level == 16) { SetPlayerColor(para1, COLOR_WHITE); PlayerInfo[para1][pChar] = 16; } //Parking Servis-Parking Service if(level == 0) { gTeam[para1] = 3; PlayerInfo[para1][pTeam] = 3; } else if(level == 1 || level == 2 || level == 3) { gTeam[para1] = 2; PlayerInfo[para1][pTeam] = 2; } else if(level == 4) { gTeam[para1] = 1; PlayerInfo[para1][pTeam] = 1; } else { gTeam[para1] = 15; PlayerInfo[para1][pTeam] = 15; } SetPlayerSkin(para1, PlayerInfo[para1][pChar]); if(level == 0) { PlayerInfo[para1][pRank] = 0; } else { PlayerInfo[para1][pRank] = 6; } } } } else { SendClientMessage(playerid, COLOR_GRAD1, " Niste autorizovani da bi ste Koristiteli ovu komandu!"); } } return 1; }