[Ajuda] Ver comandos digitados - 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] Ver comandos digitados (
/showthread.php?tid=594812)
Ver comandos digitados -
DexterClark - 23.11.2015
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
Re: Ver comandos digitados -
SaDaN - 23.11.2015
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);
}
}