[Ajuda] Comando com rcon
#1

pawn Код:
COMMAND:daradmin(playerid, params[])
{
// Setup local variables
new OtherPlayer, Level, Msg[128], Name[24], AdminName[24], OldLevel;

// Send the command to all admins so they can see it
SendAdminText(playerid, "/daradm", params);

// Check if the player has logged in
if (APlayerData[playerid][LoggedIn] == true)
{
// Check if the player's admin-level is at least 5
if (APlayerData[playerid][PlayerLevel] >= 5)
{
if (sscanf(params, "ui", OtherPlayer, Level)) SendClientMessage(playerid, 0xFF0000AA, "Digite: \"/daradm <Player> <AdminLevel>\"");
else
{
// Check if that other player is online
if (IsPlayerConnected(OtherPlayer))
{
// Get the old level of the other player
OldLevel = APlayerData[OtherPlayer][PlayerLevel];
// Get the playername of the admin
GetPlayerName(playerid, AdminName, sizeof(AdminName));
// Also get the name of the player that has been promoted
GetPlayerName(OtherPlayer, Name, sizeof(Name));
// Store the level of the player
APlayerData[OtherPlayer][PlayerLevel] = Level;
// Let all players know about it
if (OldLevel != Level)
{
// Check if the player has been promoted or demoted
if (OldLevel < Level)
format(Msg, 128, "{00FF00}-|O Player {FFFFFF}%s {00FF00}Foi Promovido a {FFFFFF}%s {00FF00}por {FFFFFF}%s{00FF00}|-", Name, AdminLevelName[Level], AdminName);
if (OldLevel > Level)
format(Msg, 128, "{FF0000}-|O Player{FFFFFF} %s {FF0000}Foi Rebaixado a {FFFFFF}%s por {FFFFFF}%s{FF0000}|-", Name, AdminLevelName[Level], AdminName);
SendClientMessageToAll(0x00FFFFFF, Msg);
}
else
SendClientMessage(playerid, 0xFF0000FF, "O Level de outro Jogador nao Foi Alterado");
}
else
SendClientMessage(playerid, 0xFF0000FF, "O Player nao esta Online");
}
}
else
return 0;
}
else
return 0;

// Let the server know that this was a valid command
return 1;
}

Queria Fazer esse comando aew de cima funcionar logado na rcon ,
Ex : O Cara nao й admin lv 5 , mais tem a senha rcon , e pode usar esse comando

eu tentei colocar assim

pawn Код:
if (!IsPlayerAdmin(playerid) && APlayerData[playerid][PlayerLevel] >= 5)
mais nao funciona !

ME AJUDA AEW
Reply
#2

Manolo tenta sem o "!"

desse jeito:

if(IsPlayerAdmin(playerid) && APlayerData[playerid][PlayerLevel] >= 5)
Reply
#3

@OFF Um comando tгo simples com tanta coisa .

Mais tenta ai:

pawn Код:
if (sscanf(params, "ud", OtherPlayer, Level)) SendClientMessage(playerid, 0xFF0000AA, "Digite: \"/daradm <Player> <AdminLevel>\""); //Troque o parametro "i" por "d" .
E tire o " ! " como aquele acima falou .
Reply
#4

assim o cara pode ser rcon ou adm level 5 para setar adm em alguem

pawn Код:
COMMAND:daradmin(playerid, params[])
{
    new OtherPlayer, Level, Msg[128], Name[24], AdminName[24], OldLevel;

    SendAdminText(playerid, "/daradm", params);

    if (APlayerData[playerid][LoggedIn] == true)
    {
        if (APlayerData[playerid][PlayerLevel] >= 5 || IsPlayerAdmin(playerid))
        {
            if (sscanf(params, "ud", OtherPlayer, Level)) return SendClientMessage(playerid, 0xFF0000AA, "Digite: \"/daradm <Player> <AdminLevel>\"");
            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, "{00FF00}-|O Player {FFFFFF}%s {00FF00}Foi Promovido a {FFFFFF}%s {00FF00}por {FFFFFF}%s{00FF00}|-", Name, AdminLevelName[Level], AdminName);
                    if (OldLevel > Level) format(Msg, 128, "{FF0000}-|O Player{FFFFFF} %s {FF0000}Foi Rebaixado a {FFFFFF}%s por {FFFFFF}%s{FF0000}|-", Name, AdminLevelName[Level], AdminName);
                    SendClientMessageToAll(0x00FFFFFF, Msg);
                }
                else return SendClientMessage(playerid, 0xFF0000FF, "O Level de outro Jogador nao Foi Alterado");
            }
            else  return SendClientMessage(playerid, 0xFF0000FF, "O Player nao esta Online");
        }
    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)