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



Command Server - qmnty - 17.02.2015

how to check the command that is not from the server ?

I 've made ​​it and put it to function OnPlayerCommandReceived .

But it only applies to the command that is available on the server , for a command that is not from the server can still be used .

Thanks before it,


Re: Command Server - Sew_Sumi - 17.02.2015

Quote:
Originally Posted by Zeex
Посмотреть сообщение
Important: Since v0.3 OnPlayerCommandText cannot be used anymore (also ZCMD_NO_CALLBACK option has been removed), but there are two new callbacks instead:

pawn Код:
OnPlayerCommandReceived(playerid, cmdtext[])
This one is called when someone sends a command. If you return 0 here, the command won't be performed.

pawn Код:
OnPlayerCommandPerformed(playerid, cmdtext[], success)
And this one gets called after command execution, here if you do "return 0" the player will see standard "Unknown command" message. The "success" parameter is equal to value returned by command function returns (if it doesn't exist success will be 0).

Note that it's not necessary to add these callbacks to your script if you don't use them.
Should be using OnPlayerCommandPerformed a bit more maybe.

Being that the Received portion, won't return the error message.


Re: Command Server - SnG.Scot_MisCuDI - 17.02.2015

pawn Код:
public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
    if(!success) return SendClientMessage(playerid, COLOR_RED, "Unknown command");
    return 1;
}



Re: Command Server - qmnty - 21.02.2015

No i mean.

command that's from C*EO, SAM*FUNCS, and another.

How to check command that is from there?


Re: Command Server - Sew_Sumi - 21.02.2015

Quote:
Originally Posted by qmnty
Посмотреть сообщение
No i mean.

command that's from C*EO, SAM*FUNCS, and another.

How to check command that is from there?
That's client side... You can't check for that.