A Command Question
#1

Heyho, i wanna ask how to make an Command that Admins see which Command type the Players also when a Player type "/rules", that a Message come to the Admin like "[CMD] Playername: /rules". I have no Idea for that.
Reply
#2

Something like this(if using zcmd, u never said)
pawn Код:
public OnPlayerCommandReceived(playerid, cmdtext[])
{
for(new i = 0; i < MAX_PLAYERS; i++)
    {
          if(IsPlayerAdmin(i))
                 {
                       new name[MAX_PLAYER_NAME];GetPlayerName(playerid,name, sizeof name);
                       new str3[68];format(str3, sizeof str3,"[CMD] %s: %s",name,cmdtext);
                 }
    }
}
Sorry or the tab sizes but I'm on my phone ;x
Reply
#3

Yep i use ZCMD. And i got a Error:

warning 203: symbol is never used: "OnPlayerCommandReceived"

Can you help me?
Reply
#4

Edited my post,
This happens becouse that should be a public and its thinking its a function.
So just put a "public" I front of it or copy my previous post again.
Reply
#5

Now: warning 219: local variable "str" shadows a variable at a preceding level

on the line: new str[68];format(str, sizeof str,"[CMD] %s: %s",name,cmdtext);
Reply
#6

C'mon you can't fix that yourself, seriously ?
It shows it becouse you already have the variable "str"
I edited it again.
Reply
#7

Overlooked but thanks.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)