[Ajuda] Comando
#1

Bom Vim Aqui pedir ajuda de voces de um comando pra ver os admins online , exemplo o player digita /admins ai aparece os admins que estгo logados no rcon e em tudo alguem me ajuda porfavor .
Reply
#2

Nгo sei como й formado seu sistema de Admin, entгo nao tem como ajudar se vocк nгo posta.
Mas ta aqui o CMD em zcmd ( vocк nгo especificou o processador de comandos qe queria entao fiz ao meu gosto ).

pawn Код:
CMD:admins(playerid,params[])
{
    new Msg[128];
    for (new i; i < MAX_PLAYERS; i++)
    if (IsPlayerConnected(i))
    {
        GetPlayerName(i, Name, sizeof(Name));
        if (IsPlayerAdmin(i))
        {
            format(Msg, 128, "Admin-RCON %s logado, ID: %i.", Name, i);
            SendClientMessage(0x00FF00FF, Msg);
        }
    }
}
Reply
#3

Quote:
Originally Posted by Nill.Oliveira
Посмотреть сообщение
Nгo sei como й formado seu sistema de Admin, entгo nao tem como ajudar se vocк nгo posta.
Mas ta aqui o CMD em zcmd ( vocк nгo especificou o processador de comandos qe queria entao fiz ao meu gosto ).

pawn Код:
CMD:admins(playerid,params[])
{
    new Msg[128];
    for (new i; i < MAX_PLAYERS; i++)
    if (IsPlayerConnected(i))
    {
        GetPlayerName(i, Name, sizeof(Name));
        if (IsPlayerAdmin(i))
        {
            format(Msg, 128, "Admin-RCON %s logado, ID: %i.", Name, i);
            SendClientMessage(0x00FF00FF, Msg);
        }
    }
}
Desculpe eu sei que nгo coloquei o formato. mais poderia colocar para strcmp
Reply
#4

Ver se funciona, nгo sei se ta correto, pois nгo sei muito sobre strcmp.

pawn Код:
if (strcmp("/admins", cmdtext, true, 7) == 0)
    {
        new Msg[128];
        for (new i; i < MAX_PLAYERS; i++)
        if (IsPlayerConnected(i))
        {
            GetPlayerName(i, Name, sizeof(Name));
            if (IsPlayerAdmin(i))
            {
                format(Msg, 128, "Admin-RCON %s logado, ID: %i.", Name, i);
                SendClientMessage(0x00FF00FF, Msg);
            }
        }
    }
Reply
#5

Quote:
Originally Posted by Nill.Oliveira
Посмотреть сообщение
Ver se funciona, nгo sei se ta correto, pois nгo sei muito sobre strcmp.

pawn Код:
if (strcmp("/admins", cmdtext, true, 7) == 0)
    {
        new Msg[128];
        for (new i; i < MAX_PLAYERS; i++)
        if (IsPlayerConnected(i))
        {
            GetPlayerName(i, Name, sizeof(Name));
            if (IsPlayerAdmin(i))
            {
                format(Msg, 128, "Admin-RCON %s logado, ID: %i.", Name, i);
                SendClientMessage(0x00FF00FF, Msg);
            }
        }
    }
Deu 4 Erros

Quote:

C:\Users\NILSON\Desktop\samp03e_svr_R2_win32\pawno \Yago.pwn(96) : error 017: undefined symbol "Name"
C:\Users\NILSON\Desktop\samp03e_svr_R2_win32\pawno \Yago.pwn(96) : error 017: undefined symbol "Name"
C:\Users\NILSON\Desktop\samp03e_svr_R2_win32\pawno \Yago.pwn(96) : error 029: invalid expression, assumed zero
C:\Users\NILSON\Desktop\samp03e_svr_R2_win32\pawno \Yago.pwn(96) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


4 Errors.

LINHA DO ERRO

Quote:

GetPlayerName(i, Name, sizeof(Name));
Reply
#6

acrecenta la
pawn Код:
new Name[MAX_PLAYER_NAME];
coloca embaixo do new Msg[128];
Reply
#7

Quote:
Originally Posted by Nill.Oliveira
Посмотреть сообщение
acrecenta la
pawn Код:
new Name[MAX_PLAYER_NAME];
coloca embaixo do new Msg[128];
1 erro

Quote:

C:\Users\NILSON\Desktop\samp03e_svr_R2_win32\pawno \Yago.pwn(102) : error 035: argument type mismatch (argument 2)
C:\Users\NILSON\Desktop\samp03e_svr_R2_win32\pawno \Yago.pwn(106) : warning 217: loose indentation
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Error.

LINHA DO ERRo
Quote:

SendClientMessage(0x00FF00FF, Msg);

Reply
#8

Tenta dessas duas formas .. por isso qe eu nun gosto de strcmp pq й complicado ..
pawn Код:
if(strcmp(cmdtext, "/admins", true) == 0)
{
    new Name[24], msg[120];
    for(new i=0; i<MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i) && IsPlayerAdmin(i))
        {
            GetPlayerName(i,Name,24);
            format(msg,sizeof(msg),"Admins Online's: %s", Name);
            SendClientMessage(playerid, 0x000FFFAA, msg);
        }
    }
return 1;
}
pawn Код:
if (strcmp("/admins", cmdtext, true, 7) == 0)
    {
        new  Name[24], Msg[128];
        for (new i; i < MAX_PLAYERS; i++)
        if (IsPlayerConnected(i))
        {
            GetPlayerName(i, Name, sizeof(Name));
            if (IsPlayerAdmin(i))
            {
                format(Msg, 128, "Admin-RCON %s logado, ID: %i.", Name, i);
                SendClientMessage(0x00FF00FF, Msg);
            }
        }
    }
Reply
#9

Quote:
Originally Posted by Nill.Oliveira
Посмотреть сообщение
pawn Код:
SendClientMessage(0x00FF00FF, Msg);
Ta faltando um parametro nisso nгo acha?
Reply
#10

Quote:
Originally Posted by tonisantolia
Посмотреть сообщение
Ta faltando um parametro nisso nгo acha?
Como й o certo ?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)