DCMD question - 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: DCMD question (
/showthread.php?tid=82570)
DCMD question -
BSMan - 19.06.2009
lets say i have that command:
if(strcmp(cmd, "/ooc", true) == 0 || strcmp(cmd, "/o", true) == 0)
it has 2 ways to be called: /ooc or /o.
can i make ONE dcmd function that will do it? (2 command names for one function)?
if so, how?
Re: DCMD question -
Vince - 19.06.2009
This should work:
pawn Code:
dcmd_ooc(playerid, params[])
{
// stuff in here
return 1;
}
dcmd_o(playerid, params[])
{
dcmd_ooc(playerid, params);
return 1;
}
Re: DCMD question -
BSMan - 19.06.2009
thanks
haha very nice solution
Re: DCMD question -
kaisersouse - 19.06.2009
Quote:
Originally Posted by BSMan
thanks
haha very nice solution
|
You can also call dcmd_commands from pretty much anywhere in the script. I use them in menus as well.
Re: DCMD question -
BSMan - 19.06.2009
yeah off course
they are just like a regular functions
Re: DCMD question -
yezizhu - 19.06.2009
Quote:
Originally Posted by BSMan
yeah off course
they are just like a regular functions
|
They're functions
Re: DCMD question -
BSMan - 19.06.2009
:S
thats what i said