Код:
if(strcmp(cmd, "/makeleader", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "{00FF00}Folosire:{FFFFFF} /makeleader [playerid/numejucator] [Number(1-16)]");
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, " ID-ul factiunii trebuie sa fie cuprins intre 0 si 16!"); return 1; }
if (PlayerInfo[playerid][pAdmin] >= 6)
{
if(IsPlayerConnected(para1))
{
if(para1 != INVALID_PLAYER_ID)
{
/*if(PlayerInfo[para1][pMember] > 0 || PlayerInfo[para1][pFMember] < 255)
{
SendClientMessage(playerid, COLOR_GREY, " That player is not in a faction/family !");
return 1;
}*/
GetPlayerName(para1, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
PlayerInfo[para1][pMember] = level;
PlayerInfo[para1][pLeader] = level;
PlayerInfo[para1][pRank] = 6;
format(string, sizeof(string), " Ai fost promovat la rangul de Lider de catre administratorul %s", sendername);
SendClientMessage(para1, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), " %s este acum liderul factiunii cu numarul %d.", giveplayer,level);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
Update(para1, pLeaderx);
if(level == 0) { PlayerInfo[para1][pModel] = 29; PlayerInfo[para1][pRank] = 0; gTeam[para1] = 3; SetPlayerSkin(para1, 29); PlayerInfo[para1][pTeam] = 0; Update(para1, pModelx); Update(para1, pRankx); return 1; }
else if(level == 1) { PlayerInfo[para1][pModel] = 265; PlayerInfo[para1][pRank] = 7; SetPlayerSkin(para1, PlayerInfo[para1][pModel]); } //Police Force
else if(level == 2) { PlayerInfo[para1][pModel] = 295; PlayerInfo[para1][pRank] = 7; SetPlayerSkin(para1, PlayerInfo[para1][pModel]); } //SRI/ATF
else if(level == 3) { PlayerInfo[para1][pModel] = 287; PlayerInfo[para1][pRank] = 7; SetPlayerSkin(para1, PlayerInfo[para1][pModel]); } //Garda Nationala
else if(level == 4) { PlayerInfo[para1][pModel] = 228; PlayerInfo[para1][pRank] = 6; SetPlayerSkin(para1, PlayerInfo[para1][pModel]); } //Fire/Ambulance
else if(level == 5) { PlayerInfo[para1][pModel] = 120; PlayerInfo[para1][pRank] = 7; SetPlayerSkin(para1, PlayerInfo[para1][pModel]); } //Dalsotro Crime
else if(level == 6) { PlayerInfo[para1][pModel] = 126; PlayerInfo[para1][pRank] = 7; SetPlayerSkin(para1, PlayerInfo[para1][pModel]); } //Martynos
else if(level == 7) { PlayerInfo[para1][pModel] = 147; PlayerInfo[para1][pRank] = 6; SetPlayerSkin(para1, PlayerInfo[para1][pModel]); } //Mayor
else if(level == 8) { PlayerInfo[para1][pModel] = 294; PlayerInfo[para1][pRank] = 7; SetPlayerSkin(para1, PlayerInfo[para1][pModel]); } //Hitmans
else if(level == 9) { PlayerInfo[para1][pModel] = 57; PlayerInfo[para1][pRank] = 6; SetPlayerSkin(para1, PlayerInfo[para1][pModel]); } //News Reporters
else if(level == 10) { PlayerInfo[para1][pModel] = 61; PlayerInfo[para1][pRank] = 6; SetPlayerSkin(para1, PlayerInfo[para1][pModel]); } //Agentia Taxi
else if(level == 11) { PlayerInfo[para1][pModel] = 171; PlayerInfo[para1][pRank] = 6; SetPlayerSkin(para1, PlayerInfo[para1][pModel]); } //Driving/Flying School
else if(level == 12) { PlayerInfo[para1][pModel] = 3; PlayerInfo[para1][pRank] = 7; SetPlayerSkin(para1, PlayerInfo[para1][pModel]); } //Sindacco Crime Family
else if(level == 13) { PlayerInfo[para1][pModel] = 112; PlayerInfo[para1][pRank] = 7; SetPlayerSkin(para1, PlayerInfo[para1][pModel]); } //Diablo Family
else if(level == 14) { PlayerInfo[para1][pModel] = 270; PlayerInfo[para1][pRank] = 7; SetPlayerSkin(para1, PlayerInfo[para1][pModel]); } //The Messina Families
else if(level == 15) { PlayerInfo[para1][pModel] = 174; PlayerInfo[para1][pRank] = 7; SetPlayerSkin(para1, PlayerInfo[para1][pModel]); } //Sacra Sinistra
else if(level == 16) { PlayerInfo[para1][pModel] = 153; PlayerInfo[para1][pRank] = 6; SetPlayerSkin(para1, PlayerInfo[para1][pModel]); } //Tractari auto
gTeam[para1] = 11;
PlayerInfo[para1][pRank] = 6;
Update(para1, pModelx);
Update(para1, pRankx);
PlayerInfo[para1][pTeam] = 11;
SetPlayerSkin(para1, PlayerInfo[para1][pModel]);
}
}//not connected
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " Nu ai rangul administrativ necesar!");
}
}
return 1;
}