SA-MP Forums Archive
Sending a command withing the script - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Sending a command withing the script (/showthread.php?tid=184263)



Sending a command withing the script - [L3th4l] - 18.10.2010

So i have this help dialog, and i would like to when people chose that dialog, it sends them a command

Something like 'CallRemoteFunction' or 'CallLocalFunction'

Ok, but not sure what else it would need.

Thanks!


Re: Sending a command withing the script - LarzI - 18.10.2010

pawn Код:
CallLocalFunction("OnPlayerCommandText", "is", playerid, "/yourcommand");
I believe this also would work:

pawn Код:
OnPlayerCommandText(playerid, "/mycommand");



Re: Sending a command withing the script - [L3th4l] - 18.10.2010

Aha! Thanks LarzI. I had it like that too, just didn't knew it needed the '/'

Thanks again!


Re: Sending a command withing the script - LarzI - 19.10.2010

Typical mistake.
No problem!