08.10.2011, 19:24
Quando eu digito /daradmin todos os Comandos do meu FS para de funfar queria saber porque
COD;
COD;
PHP код:
if(strcmp(cmd, "/daradmin", true) == 0 || strcmp(cmd, "/daradmin", true) == 0)
{
tmp = strtok(cmdtext, idx);
giveplayerid = strval(tmp);
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
PlayerInfo[playerid][pAdmin] = dini_Int(udb_encode(sendername), "level");
PlayerInfo[giveplayerid][pAdmin] = dini_Int(udb_encode(giveplayer), "level");
giveplayerid = strval(tmp);
if (PlayerInfo[playerid][pAdmin] >= 7)
{
SendClientMessage(playerid, COLOR_GRAD1, "[USO]: /daradmin [ID/Nick][Level ADM]");
return 1;
}
tmp = strtok(cmdtext, idx);
if (PlayerInfo[playerid][pAdmin] >= 7)
{
SendClientMessage(playerid, COLOR_GRAD1, "[USO]: /daradmin [ID/Nick][Level ADM]");
return 1;
}
PlayerInfo[playerid][pAdmin] = dini_Int(udb_encode(sendername), "level");
level[playerid] = strval(tmp);
if(level[playerid] < 0)
{
SendClientMessage(playerid, 0x980000AA, "[ERRO] o Level de ADM й invalido");
return 1;
}
if(level[playerid] > 7)
{
SendClientMessage(playerid, 0x980000AA, "[ERRO] Level de ADM invalido.!");
return 1;
}
if(level[playerid] == PlayerInfo[giveplayerid][pAdmin])
{
format(string, sizeof(string), "Este player ja tem level %d de admin!", level[playerid]);
SendClientMessage(playerid, COLOR_BLUE, string);
return 1;
}
if(logged[playerid] == 1)
{
if(IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdmin] >= 7)
{
if(IsPlayerConnected(giveplayerid))
{
if(logged[giveplayerid] == 0)
{
SendClientMessage(playerid, COLOR_RED, "[ERRO] O player tem que estar logado para poder receber o level de admin!");
return 1;
}
else
{
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
dini_IntSet(udb_encode(giveplayer), "level", level[playerid]);
format(string, sizeof(string), "Vocк deu para %s level %d de admin!", giveplayer, level[playerid]);
SendClientMessage(playerid, COLOR_BLUE, string);
format(string, sizeof(string), "Vocк,%s, foi setado Administrador (level %d) pelo admin %s ", giveplayer ,level[playerid], sendername);
SendClientMessage(giveplayerid, COLOR_BLUE, string);
PlayerInfo[giveplayerid][pAdmin] = dini_Int(udb_encode(giveplayer), "level");
new PlayerName[30];
GetPlayerName(playerid, PlayerName, 30);
printf("[Command] %s usou /setadmin para dar par %s level %d de admin.", PlayerName, giveplayer, level[playerid]);
}
}
else
{
format(string, sizeof(string), "%d nгo й o nъmero de ID de um player ativo!", giveplayerid);
SendClientMessage(playerid, COLOR_RED, string);
}
}
else
{
SendClientMessage(playerid, COLOR_RED, "[ERRO] Vocк nгo tem permissгo para usar este comando!");
}
}
else
{
SendClientMessage(playerid, COLOR_RED, "[ERRO] Vocк tem que estar logado para usar este comando!");
}
return 1;
}