A Command Question - 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: A Command Question (
/showthread.php?tid=405202)
A Command Question -
Blackazur - 05.01.2013
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.
Re: A Command Question -
park4bmx - 05.01.2013
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
AW: A Command Question -
Blackazur - 05.01.2013
Yep i use ZCMD. And i got a Error:
warning 203: symbol is never used: "OnPlayerCommandReceived"
Can you help me?
Re: A Command Question -
park4bmx - 05.01.2013
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.
AW: A Command Question -
Blackazur - 05.01.2013
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);
Re: A Command Question -
park4bmx - 05.01.2013
C'mon you can't fix that yourself, seriously ?
It shows it becouse you already have the variable "str"
I edited it again.
AW: A Command Question -
Blackazur - 05.01.2013
Overlooked but thanks.