25.04.2012, 01:00
Hey guys please converted the code to ZCMD
pawn Код:
if(strcmp(cmd, "/makeleader", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "Utiliza: /makeleader [playerid/PartOfName] [Number(1-19)]");
return 1;
}
new para1;
new level;
para1 = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
level = strval(tmp);
if(level > 19 || level < 0) { SendClientMessage(playerid, COLOR_GREY, "No hay esa facciуn"); return 1; }
if (PlayerInfo[playerid][pHmm] >= 5)
{
if(IsPlayerConnected(para1))
{
if(para1 != INVALID_PLAYER_ID)
{
new Fac[18];
GetPlayerName(para1, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
PlayerInfo[para1][pLeader] = level;
if(level == 0) { PlayerInfo[para1][pChar] = 0; PlayerInfo[para1][pRank] = 0; Fac = "Sin facciуn"; }
else if(level == 1) { PlayerInfo[para1][pChar] = 283; PlayerInfo[para1][pRank] = 8; Fac = "LSPD";} //LSPD
else if(level == 3) { PlayerInfo[para1][pChar] = 287; PlayerInfo[para1][pRank] = 6; Fac = "Militares";} //Milicia
else if(level == 4) { PlayerInfo[para1][pChar] = 70; PlayerInfo[para1][pRank] = 6; Fac = "SAMUR";} //SAMUR
else if(level == 6) { PlayerInfo[para1][pRank] = 6; Fac = "Taxi";} //Taxi
else if(level == 7) { PlayerInfo[para1][pRank] = 6; Fac = "Mecбnicos";} //Mecas
else if(level == 8) { PlayerInfo[para1][pChar] = 165; PlayerInfo[para1][pRank] = 6; Fac = "Umbrella 7";} //U7
else if(level == 9) { PlayerInfo[para1][pChar] = 270; PlayerInfo[para1][pRank] = 6; Fac = "Groove Street";} //GS
else if(level == 10) { PlayerInfo[para1][pChar] = 292; PlayerInfo[para1][pRank] = 6; Fac = "La Hermandad";} //LH
else if(level == 11) { PlayerInfo[para1][pChar] = 110; PlayerInfo[para1][pRank] = 6; Fac = "Latin Kings";} //LK
else if(level == 12) { PlayerInfo[para1][pChar] = 113; PlayerInfo[para1][pRank] = 7; Fac = "Mafia Italiana";} //ITA
else if(level == 13) { PlayerInfo[para1][pChar] = 294; PlayerInfo[para1][pRank] = 6; Fac = "Mafia Yakuza";} //RUS
else if(level == 14) { PlayerInfo[para1][pChar] = 290; PlayerInfo[para1][pRank] = 7; Fac = "Mafia Rusa";} //RUS
else if(level == 15) { PlayerInfo[para1][pRank] = 5; Fac = "Licencieros";} //LIC
else if(level == 16) { PlayerInfo[para1][pChar] = 295; PlayerInfo[para1][pRank] = 2; Fac = "Gobierno";} //GOB
else if(level == 17) { PlayerInfo[para1][pRank] = 6; Fac = "CNN";} //CNN
else if(level == 18) { PlayerInfo[para1][pRank] = 8; Fac = "Banqueros";} //BANK
else if(level == 19) { PlayerInfo[para1][pChar] = 95; PlayerInfo[para1][pRank] = 6; Fac = "Narcotraficantes";} //NARCO
SetPlayerSkin(para1, PlayerInfo[para1][pChar]);
format(string, sizeof(string), "(Admin:%s)Recibiste el liderato de la facciуn: %s", sendername, Fac);
SendClientMessage(para1, 0xFF7735FF, string);
format(string, sizeof(string), "Has dado a %s liderato de la facciуn: %s", giveplayer,Fac);
SendClientMessage(playerid, 0xFF7735FF, string);
}
}
}
else return Message(playerid, COLOR_GRAD1, "No autorizado!");
}
return 1;
}