Calling a command - 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: Calling a command (
/showthread.php?tid=97985)
Calling a command -
potato - 18.09.2009
Hi!
I'm using ZCMD.
How can I call a textcommand from a function?
Like when someone types /dosome - it will go to ... actually I don't know where it goes and that is the problem, but the function dosome is defined by zcmd(dosome, playerid, params[]) {... }
How can I call this command inside a function?
Like something OnPlayerCommandText(playerid, "/dosome");
Also I need the params...
So format(text, 256, "/dosome %d", playerid);
OnPlayerCommandText(playerid, text);
but doesn't work... any other ideas?
Re: Calling a command -
Correlli - 18.09.2009
Ask in ZCMD topic.
Re: Calling a command -
potato - 18.09.2009
Don't think this really matters.
Can I even do something like this:
format(text, 256, "/dosome %d", playerid);
OnPlayerCommandText(playerid, text);
?
Even if the /dosome function is a non-zcmd command?
Re: Calling a command -
Correlli - 18.09.2009
Yes, and you don't need 256 cells, 128 is enough.
Re: Calling a command -
potato - 18.09.2009
Oh, well I found it anyway.
It's zcmd_%1(%2, %3);
name, playerid, params...