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=445700)



~fixed~ - Blackazur - 22.06.2013

~fixed~


Re: OnPlayerCommandPerformed - Scenario - 22.06.2013

pawn Код:
if(pInfo[playerid][pAdminLevel] >= 1)
is checking to see if the admin level is greater than or equal to one. If it is, then it sends a message to the admins about the command used.

If you want it to only show commands used by players, change that check to see if the admin level equals 0.


~fixed~ - Blackazur - 22.06.2013

~fixed~


Re: OnPlayerCommandPerformed - Scenario - 22.06.2013

Apparently you never studied math.

> means GREATER THAN
< means LESS THAN
= means EQUAL TO

The first piece of code will check if the admin level is greater than or equal to 0. This is not what you want. The second piece of code will check if the admin level is greater than 0. This is not what you want.

What you want is to see if the admin level EQUALS 0; you can do this by using the = sign (or more accurately, since this is PAWN, ==). Try again!


Re: OnPlayerCommandPerformed - Red_Dragon. - 22.06.2013

pawn Код:
if(pInfo[playerid][pAdminLevel] == 0 )
As you need it to check to see if the admin level equals 0.

EDIT: Too late. Anyway, check the operators here https://sampwiki.blast.hk/wiki/Control_Structures