[Ajuda] Ver comandos digitados
#1

Estou com um poblema aqui... estгo atacando meu servidor,baixei uma gamemode da internet.
[...]E agora estou tentando criar um sistema de ver os comandos digitados para saber o comando que usam...

Cуdigo que peguei:
pawn Код:
for(new i=0; i<MAX_PLAYERS; i++)
    {
        if(IsPlayerAdmin(i))
        {
            new stringcmd[256];
            new playa[MAX_PLAYER_NAME];
            GetPlayerName(playerid, playa, MAX_PLAYER_NAME);
            format(stringcmd, 256, "O jogador %s (ID: %d) digitou o comando: %s", playa, playerid, cmdtext);
            SendClientMessage(i,0xFFFFFFAA, stringcmd);
            return 1;
        }
    }
Esse codigo a cima , eu coloquei na public OnPlayerCommandText.

pawn Код:
if(!strcmp(cmd, "/kill", true))
{
        SetPlayerHealth(playerid, 0.0);
        return 1;
}
// Poe ele aqui, assim:
    for(new i=0; i<MAX_PLAYERS; i++)
    {
        if(IsPlayerAdmin(i))
        {
            new stringcmd[256];
            new playa[MAX_PLAYER_NAME];
            GetPlayerName(playerid, playa, MAX_PLAYER_NAME);
            format(stringcmd, 256, "O jogador %s (ID: %d) digitou o comando: %s", playa, playerid, cmdtext);
            SendClientMessage(i,0xFFFFFFAA, stringcmd);
            return 1;
        }
    }
E este... este de cima , й para por na ultima linha de cуdigos... sу a parte do for new e tals..
Mas deu este erro:
pawn Код:
C:\Users\Kauг\Desktop\Jogos\Gamemode\gamemodes\GMBHS.pwn(58899) : error 017: undefined symbol "cmdtext"
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


1 Error.
Sei que й muita coisa para processar... mais qualquer ajuda й bem-vinda
Reply
#2

Coloca isso no topo de OnPlayerCommandText, antes dos comandos.

Код:
    for(new i=0; i<MAX_PLAYERS; i++)
    {
        if(IsPlayerAdmin(i))
        {
            new stringcmd[256];
            new playa[MAX_PLAYER_NAME];
            GetPlayerName(playerid, playa, MAX_PLAYER_NAME);
            format(stringcmd, 256, "O jogador %s (ID: %d) digitou o comando: %s", playa, playerid, cmdtext);
            SendClientMessage(i,0xFFFFFFAA, stringcmd);
        }
    }
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)