21.10.2012, 05:57
PHP код:
if(strcmp(cmd, "/setorg", true) == 0 || strcmp(cmd, "/setlevelorg", true) == 0)
{
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,0xD8D8D8FF,"ERRO: Vocк nгo esta logado na rcon!");
tmp = strtok(cmdtext, idx);
giveplayerid = strval(tmp);
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
giveplayerid = strval(tmp);
if(!strlen(tmp) && PlayerInfo[playerid][pAdmin] >= 5)
{
SendClientMessage(playerid, 0xD8D8D8FF, "Uso correto: /setorg [id do player] [level]");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp) && PlayerInfo[playerid][pAdmin] >= 5)
{
SendClientMessage(playerid, 0xD8D8D8FF, "Uso correto: /setorg [id do player] [level]");
return 1;
}
Admin[playerid] = strval(tmp);
if(Admin[playerid] < 0)
{
SendClientMessage(playerid, 0xD8D8D8FF, "Level de ORG invбlido!");
return 1;
}
if(Admin[playerid] > 5)
{
SendClientMessage(playerid, 0xD8D8D8FF, "Level de ORG invбlido!");
return 1;
}
if(Admin[playerid] == PlayerInfo[giveplayerid][pAdmin])
{
format(string, sizeof(string), "Este player ja tem level %d de ORG!", Admin[playerid]);
SendClientMessage(playerid, 0xD8D8D8FF, string);
return 1;
}
if(logado[playerid] == 1)
{
if(IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdmin] >= 5)
{
if(IsPlayerConnected(giveplayerid))
{
if(logado[giveplayerid] == 0)
{
SendClientMessage(playerid, 0xD8D8D8FF, "O player tem que estar logado para poder receber o level de admin!");
return 1;
}
else
{
new Nome[MAX_PLAYER_NAME];
GetPlayerName(giveplayerid, Nome, sizeof(Nome));
new String[50];
format(String, sizeof(String), CONTAS, Nome);
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
dini_IntSet(String,"Admin", Admin[playerid]);
format(string, sizeof(string), " Vocк promoveu %s a nivel %d de ORG.", giveplayer, Admin[playerid]);
SendClientMessage(playerid, COR_ADM, string);
format(string, sizeof(string), " Vocк foi promovido Organizador, pelo admin %s. /comandosorg", Admin[playerid], sendername);
SendClientMessage(giveplayerid, ROXO, string);
PlayerInfo[giveplayerid][pAdmin] = dini_Int(String, "Admin");
format(string,sizeof(string),"-OpenServer- O CONFEDERAЗГO %s mudou o level de %s para ORGANIZADOR DE SUA TORCIDA.",sendername,giveplayer,Admin[playerid]);
for(new i=0;i<MAX_PLAYERS;i++)
if(PlayerInfo[i][pAdmin] >= 1 || PlayerInfo[playerid][pAdmin] == 1)
SendClientMessage(i,0xFFA579AA,string);
new PlayerName[30];
GetPlayerName(playerid, PlayerName, 30);
printf("[COPA NORTE SUDESTE NORDESTE] %s usou /setorg para dar par %s level %d de ORG.", PlayerName, giveplayer, Admin[playerid]);
}
}
else
{
format(string, sizeof(string), "ERRO: ID %d nгo estб onlie.", giveplayerid);
SendClientMessage(playerid, 0xD8D8D8FF, string);
}
}
else
{
SendClientMessage(playerid, 0xD8D8D8FF, "ERRO: Vocк nгo tem permissгo para usar este comando!");
}
}
else
{
SendClientMessage(playerid, 0xD8D8D8FF, "ERRO: Vocк tem que estar logado para usar este comando!");
}
return 1;
}