Код HTML:
if(strcmp(cmd, "/promover", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "Use: /Promover [id] [Cargos 1 a 5] OBS:[Cargos 100 e 200 sгo Sub-Lideres]");
return true;
}
new para1;
new level;
para1 = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
level = strval(tmp);
if(level != 1 && level != 2 && level != 3 && level != 4 && level != 5 && level != 100 && level != 200)
{
SendClientMessage(playerid, COLOR_GREY, " [Cargos 1 a 5] OBS:Cargos 100 e 200 sгo Sub-Lideres");
return true;
}
if (PlayerInfo[playerid][pLider] > 0)
{
if(IsPlayerConnected(para1))
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(PlayerInfo[para1][pMembro] == PlayerInfo[playerid][pLider])
{
if(para1 != INVALID_PLAYER_ID)
{
GetPlayerName(para1, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
PlayerInfo[para1][pCargo] = level;
format(string, sizeof(string), " Vocк foi promovido pelo lнder %s", PlayerName(playerid));
SendClientMessage(para1, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), " Vocк promoveu %s a cargo %d.", giveplayer,level);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
new org = PlayerInfo[playerid][pLider];
if(level == 100)
{
if(strcmp(InfoOrg[org][SubLider],"Ninguem",true)==0)
{
DemitirInfoOrg(giveplayer);
ConviteInfoOrg(giveplayer, org, 100);
}
else
{
strmid(string, InfoOrg[org][SubLider], 0, strlen(InfoOrg[org][SubLider]), 255);
DemitirInfoOrg(giveplayer);
DemitirInfoOrg(InfoOrg[org][SubLider]);
ConviteInfoOrg(string, org, 4);
ConviteInfoOrg(giveplayer, org, 100);
}
return true;
}
else if(level == 200)
{
if(strcmp(InfoOrg[org][SubLider2],"Ninguem",true)==0)
{
DemitirInfoOrg(giveplayer);
DemitirInfoOrg(giveplayer);
ConviteInfoOrg(giveplayer, org, 200);
}
else
{
strmid(string, InfoOrg[org][SubLider2], 0, strlen(InfoOrg[org][SubLider2]), 255);
DemitirInfoOrg(giveplayer);
DemitirInfoOrg(InfoOrg[org][SubLider2]);
ConviteInfoOrg(string, org, 4);
ConviteInfoOrg(giveplayer, org, 200);
}
return true;
}
if(strcmp(InfoOrg[org][SubLider],giveplayer,true)==0)
{
if(level < 100)
{
DemitirInfoOrg(giveplayer);
ConviteInfoOrg(giveplayer, org, level);
}
return true;
}
}
if(PlayerInfo[para1][pMembro] != PlayerInfo[playerid][pLider])
{
SendClientMessage(playerid, COLOR_GREY, "Nгo pode promover quem nгo й da sua org.");
return true;
}
}
}
}//not connected
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, "Vocк nгo й um lнder !");
}
}
return true;
}