SA-MP Forums Archive
OnPlayerCommandPerformed - 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: OnPlayerCommandPerformed (/showthread.php?tid=544457)



Re: OnPlayerCommandPerformed - Dziugsas - 02.11.2014

Check if player is admin - if not format the string and send to admins.That should help...


OnPlayerCommandPerformed - TuNiSiAnO1 - 02.11.2014

Hello i have script to see the commands that players typed, my problem is i can see the cmd i have typed aswell and i dont want that, anything i can do about that and thanks.

PHP код:
public OnPlayerCommandPerformed(playeridcmdtext[], success)
{
  new 
str[100], name[24];
  
GetPlayerName(playerid,name,sizeof(name));
  
format(str,sizeof(str),"(CMD)%s used: %s",name,cmdtext);
  for(new 
i=0i<MAX_PLAYERSi++)
  {
    if(
IsPlayerAdmin(i))
    {
      
SendClientMessage(i,Green2,str);
    }
  }
  print(
str);
  
//****************************************************************************
  
return 1;




Re: OnPlayerCommandPerformed - [HiC]TheKiller - 02.11.2014

Just change the line
pawn Код:
if(IsPlayerAdmin(i))
To

pawn Код:
if(IsPlayerAdmin(i) && i != playerid)



Re: OnPlayerCommandPerformed - TuNiSiAnO1 - 02.11.2014

Quote:
Originally Posted by [HiC]TheKiller
Посмотреть сообщение
Just change the line
pawn Код:
if(IsPlayerAdmin(i))
To

pawn Код:
if(IsPlayerAdmin(i) && i != playerid)
Thank you =)