SA-MP Forums Archive
[Ajuda]GMX - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Ajuda]GMX (/showthread.php?tid=322618)



[Ajuda]GMX - GustavoPontes - 03.03.2012

eu criei um sistema de gmx mas eu queria criar apenas para admin lvl 1337 o sitema que criei й esse e queria saber como colocar sу pra admin 1337
Quote:

if (strcmp("/gmx", cmdtext, true, 10) == 0)
{
SendRconCommand("gmx");
new pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, MAX_PLAYER_NAME);
format(string, sizeof(string), "[ GMX ] O Administrador %s reiniciou o Servidor!!", pname);
SendClientMessageToAll(-1, string);
return 1;
}




Re: [Ajuda]GMX - Lуs - 03.03.2012

pawn Код:
if(PlayerInfo[playerid][pAdmin] != 1337) return SendClientMessage(playerid, -1, "Vocк nгo й administrador level 1337!");



Respuesta: [Ajuda]GMX - GustavoPontes - 03.03.2012

coloca aonde?


Re: [Ajuda]GMX - Lуs - 03.03.2012

pawn Код:
if (strcmp("/gmx", cmdtext, true, 10) == 0)
{
    if(PlayerInfo[playerid][pAdmin] != 1337) return SendClientMessage(playerid, -1, "Vocк nгo й administrador level 1337!");
    SendRconCommand("gmx");
    new pname[MAX_PLAYER_NAME];
    GetPlayerName(playerid, pname, MAX_PLAYER_NAME);
    format(string, sizeof(string), "[ GMX ] O Administrador %s reiniciou o Servidor!!", pname);
    SendClientMessageToAll(-1, string);
    return 1;
}



Re: [Ajuda]GMX - Caio_Freeze - 03.03.2012

Tenta Assim e ve se funciona

pawn Код:
if (strcmp("/gmx", cmdtext, true, 10) == 0)
{
if(PlayerInfo[playerid][pAdmin] != 1337) return SendClientMessage(playerid, -1, "Vocк nгo й administrador level 1337!");
SendRconCommand("gmx");
new pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, MAX_PLAYER_NAME);
format(string, sizeof(string), "[ GMX ] O Administrador %s reiniciou o Servidor!!", pname);
SendClientMessageToAll(-1, string);
return 1;
}



Re: [Ajuda]GMX - DouglasRodrigues - 03.03.2012

pawn Код:
if(strcmp(cmd, "/gmx", true) == 0 || strcmp(cmd, "/restart", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            //new string22[128];
            if (PlayerInfo[playerid][pAdmin] >=1337)
            {
                if(admtrampando[playerid] < 1 && PlayerInfo[playerid][pAdmin] != 1337) { return SendClientMessage(playerid, COLOR_GRAD1, "Vocк nгo estб trabalhando! (/trabalhar)"); }
                for(new i = 0; i < MAX_PLAYERS; i++)
                {
                    if(IsPlayerConnected(i))
                    { OnPlayerSave(i); }
                }
                GameTextForPlayer(playerid, "~g~G~y~M~b~X~n~~p~Reiniciando, Aguarde... ", 3000, 3);
                GameModeExitFunc();
                SaveAccounts();
                OnPlayerSave(playerid);
            }
            else
            {
                SendClientMessage(playerid, COLOR_GRAD1, "Vocк nгo tem autorizaзгo para dar GMX!");
            }
        }
        return true;
    }
Se der erro com admtrampando, coloque isso:
Topo do GM:
new admtrampando[MAX_PLAYERS];
Na public OnPlayerConnect(playerid)
admtrampando[playerid] = 0;

Espero ter ajudado


Re: [Ajuda]GMX - Lуs - 03.03.2012

Quote:
Originally Posted by Douglas_FusioN
Посмотреть сообщение
pawn Код:
if(strcmp(cmd, "/gmx", true) == 0 || strcmp(cmd, "/restart", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            //new string22[128];
            if (PlayerInfo[playerid][pAdmin] >=1337)
            {
                if(admtrampando[playerid] < 1 && PlayerInfo[playerid][pAdmin] != 1337) { return SendClientMessage(playerid, COLOR_GRAD1, "Vocк nгo estб trabalhando! (/trabalhar)"); }
                for(new i = 0; i < MAX_PLAYERS; i++)
                {
                    if(IsPlayerConnected(i))
                    { OnPlayerSave(i); }
                }
                GameTextForPlayer(playerid, "~g~G~y~M~b~X~n~~p~Reiniciando, Aguarde... ", 3000, 3);
                GameModeExitFunc();
                SaveAccounts();
                OnPlayerSave(playerid);
            }
            else
            {
                SendClientMessage(playerid, COLOR_GRAD1, "Vocк nгo tem autorizaзгo para dar GMX!");
            }
        }
        return true;
    }
Se der erro com admtrampando, coloque isso:
Topo do GM:
new admtrampando[MAX_PLAYERS];
Na public OnPlayerConnect(playerid)
admtrampando[playerid] = 0;

Espero ter ajudado
O_O




Re: [Ajuda]GMX - DouglasRodrigues - 03.03.2012

Quote:
Originally Posted by Los
Посмотреть сообщение
O_O

Tenho direito de errar >_<
Peguei o cуdigo do meu GM por ser mais completo.
Mas me liguei que pode dar muitos erros e.e


Re: [Ajuda]GMX - Lуs - 03.03.2012

Nгo й porque um cуdigo й maior que й melhor do que o outro, comparando o dele com o seu dб pra ter uma noзгo do que eu to falando.


Re: [Ajuda]GMX - leosivi - 03.03.2012

pawn Код:
if (strcmp("/gmx", cmdtext, true, 10) == 0)
{
    if(PlayerInfo[playerid][pAdmin] != 1337) return SendClientMessage(playerid, -1, "Vocк nгo й administrador level 1337!");
    SendRconCommand("gmx");
    new pname[MAX_PLAYER_NAME];
    GetPlayerName(playerid, pname, MAX_PLAYER_NAME);
    format(string, sizeof(string), "[ GMX ] O Administrador %s reiniciou o Servidor!!", pname);
    SendClientMessageToAll(-1, string);
    return 1;
}