Admins can see which command player typed?
#1

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.
Reply
#2

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

do you use zcmd?
In that case use OnPlayerCommandPerfomed.
Reply
#4

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
Reply
#5

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*
Reply
#6

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?
Reply
#7

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

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);

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)