Problemas ao /admins -
feliphemort - 21.03.2013
No meu GM de Caminhoneiro, apуs eu entrar no servidor, logar na rcon e executar "/Admins" aparece Feliphe_Mort [ID: 0] (Level: 0), E percebo que isso Sу acontece quando estou logado na rcon... Oque pode ser? Alguem ajuda?
Code:
pawn Код:
COMMAND:setlevel(playerid, params[])
{
new OtherPlayer, Level, Msg[128], Name[24], AdminName[24], OldLevel;
if (APlayerData[playerid][LoggedIn] == true)
{
if (IsPlayerAdmin(playerid))
{
if (sscanf(params, "ui", OtherPlayer, Level)) SendClientMessage(playerid, 0xFF0000AA, "Use: /setlevel [id] [nivel]");
else
{
if (IsPlayerConnected(OtherPlayer))
{
OldLevel = APlayerData[OtherPlayer][PlayerLevel];
GetPlayerName(playerid, AdminName, sizeof(AdminName));
GetPlayerName(OtherPlayer, Name, sizeof(Name));
APlayerData[OtherPlayer][PlayerLevel] = Level;
if (OldLevel != Level)
{
if (OldLevel < Level)
format(Msg, 128, "{FFFF00}[INFO] {32CD32}O Player %s foi promovido a %s por %s", Name, AdminLevelName[Level], AdminName);
if (OldLevel > Level)
format(Msg, 128, "{FFFF00}[INFO] {32CD32}O Player %s foi rebaixado a %s por %s", Name, AdminLevelName[Level], AdminName);
SendClientMessageToAll(0x00FF00FF, Msg);
}
else
SendClientMessage(playerid, 0xFF0000FF, "Level de Admin Nгo Setado.");
}
else
SendClientMessage(playerid, 0xFF0000FF, "Jogador Offline.");
}
}
else
return 0;
}
else
return 0;
return 1;
}
Re: Problemas ao /admins -
DanDRT - 21.03.2013
Manda Seu /admins '-'
Re: Problemas ao /admins -
feliphemort - 21.03.2013
Perdoe-me copiei o codigo errado :/
pawn Код:
// This command lists all online admins
COMMAND:admins(playerid, params[])
{
// Setup local variables
new AdminList[500], Name[24];
// Check if the player has logged in
if (APlayerData[playerid][LoggedIn] == true)
{
// Scan through all players
for (new i; i < MAX_PLAYERS; i++)
{
// Check if this player is connected
if (IsPlayerConnected(i))
{
// Get the name of the player
GetPlayerName(i, Name, sizeof(Name));
// Check if this player is an RCON admin
if (IsPlayerAdmin(i))
{
// Add all admin players to the list
format(AdminList, sizeof(AdminList), "%s{FAEBD7}%s [ ID %i ] - {00FF7F}(Level: %i)\n", AdminList, Name, i, APlayerData[i][PlayerLevel]); // Add the name of the admin-player to the list
// Re-start the for loop (skipping the remaining code for this iteration)
continue;
}
//Check if that player is an admin (using the PlayerLevel)
if (APlayerData[i][PlayerLevel] > 0)
{
// Add all admin players to the list
format(AdminList, sizeof(AdminList), "%s{FAEBD7}%s [ ID %i ] - {00FF7F}(Level: %i)\n", AdminList, Name, i, APlayerData[i][PlayerLevel]); // Add the name of the admin-player to the list
}
}
}
// Check if there were admin-names added to the list
if (strlen(AdminList) > 0)
ShowPlayerDialog(playerid, DialogNoResponse, DIALOG_STYLE_MSGBOX, "Administradores Online:", AdminList, "Fechar", "");
else
SendClientMessage(playerid, 0xFF0000FF, "{B0C4DE}Administraзгo offline no momento !"); // No admins are online
}
else
return 0;
// Let the server know that this was a valid command
return 1;
}
Re: Problemas ao /admins -
DanDRT - 21.03.2013
PHP код:
COMMAND:admins(playerid, params[])
{
new AdminList[500], Name[24];
if(APlayerData[playerid][LoggedIn] == true)
{
for (new i; i < MAX_PLAYERS; i++)
{
if (IsPlayerConnected(i))
{
GetPlayerName(i, Name, sizeof(Name));
if (APlayerData[i][PlayerLevel] > 0 || IsPlayerAdmin(i))
{
format(AdminList, sizeof(AdminList), "%s{FAEBD7}%s [ ID %i ] - {00FF7F}(Level: %i)\n", AdminList, Name, i, APlayerData[i][PlayerLevel]); // Add the name of the admin-player to the list
}
}
}
if (strlen(AdminList) > 0)
ShowPlayerDialog(playerid, DialogNoResponse, DIALOG_STYLE_MSGBOX, "Administradores Online:", AdminList, "Fechar", "");
else
SendClientMessage(playerid, 0xFF0000FF, "{B0C4DE}Administraзгo offline no momento !"); // No admins are online
}
else
return 0;
return 1;
}
tenta :B
Re: Problemas ao /admins -
feliphemort - 21.03.2013
Apуs logar rcon, continua aparecendo meu Nome.. e Level 0
Re: Problemas ao /admins -
feliphemort - 21.03.2013
Jб foi resolvido colega, obrigado mesmo assim.
Apenas removi a linha:
pawn Код:
// Check if this player is an RCON admin
if (IsPlayerAdmin(i))
{
// Add all admin players to the list
format(AdminList, sizeof(AdminList), "%s{FAEBD7}%s [ ID %i ] - {00FF7F}(Level: %i)\n", AdminList, Name, i, APlayerData[i][PlayerLevel]); // Add the name of the admin-player to the list
// Re-start the for loop (skipping the remaining code for this iteration)
continue;
}