SA-MP Forums Archive
Admins can see which command player typed? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Admins can see which command player typed? (/showthread.php?tid=445503)



Admins can see which command player typed? - Blackazur - 21.06.2013

Hello, how can i make that admins can see which command a player typed for example:

[CMD][PLAYERID][PLAYERNAME]: /help

I dont have any idea for that.


Re: Admins can see which command player typed? - jakejohnsonusa - 21.06.2013

Do you want them to see it in game or in a server log?


Respuesta: Admins can see which command player typed? - JustBored - 21.06.2013

do you use zcmd?
In that case use OnPlayerCommandPerfomed.


AW: Admins can see which command player typed? - HurtLocker - 21.06.2013

easy. example:
pawn Код:
CMD:help(playerid, params[])
{
//code
Getplayername(playerid)
format(str, sizeof(str), "[CMD][%d][%s]: /help", playerid, playername)
foreach(...)
{
    if (playerstats[i][adminlv]>0)
    {
        SendCLientMessage(i, -1, str)
    }
}
return 1;
}
EDIT: and you add this loop in every command with changed str


Re: Admins can see which command player typed? - dafuq - 21.06.2013

HurtLocker, he means that when someone types and CMD like /me then admins can see it IG, example:
[AdmnReport] Player *playername* *player's id* used CMD *CMD name*


AW: Re: Admins can see which command player typed? - HurtLocker - 21.06.2013

Quote:
Originally Posted by dafuq
Посмотреть сообщение
HurtLocker, he means that when someone types and CMD like /me then admins can see it IG, example:
[AdmnReport] Player *playername* *player's id* used CMD *CMD name*
Are you blind?


AW: Admins can see which command player typed? - Blackazur - 21.06.2013

i scripted it now yourself, but thanks for your help all nevertheless.


Re : Admins can see which command player typed? - yusei - 21.06.2013

Mybe this can help you
From PPC trucking :

PHP код:
// SCRIPT BY POWERPC ( PPC TRUCKING )
SendAdminText(playeridcommand[], text[])
{
    
// Setup local variables
    
new Name[24], Msg[128];
    
// Loop through all players
    
for (new iMAX_PLAYERSi++)
    {
        
// Check if the player is an admin
        
if (APlayerData[i][PlayerLevel] > 0///// ADMIN variable Change this with yours
        
{
            
// Get the player's name
            
GetPlayerName(playeridNamesizeof(Name));
            
// Send the given text to the admin
            
format(Msg128"{00FFCC}%s use: %s %s"Namecommandtext);
            
SendClientMessage(i0xFFFFFFFFMsg);
        }
    }
    
// Also log all used commands in the server.log file
    
format(Msg128"%s use: %s %s"Namecommandtext);
    print(
Msg);
}
COMMAND:test(playeridparams[])
{
    
SendAdminText(playerid"/test"params);