How to make this in dcmd? (Two commands for one function...) - 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: How to make this in dcmd? (Two commands for one function...) (
/showthread.php?tid=73102)
How to make this in dcmd? (Two commands for one function...) -
robanswe - 12.04.2009
How to make this in dcmd? (Two commands for one function...) if(strcmp(cmd, "/change", true) == 0 || strcmp(cmd, "/force", true) == 0)
Re: How to make this in dcmd? (Two commands for one function...) -
Donny_k - 12.04.2009
pawn Код:
dcmd_one( playerid, params[] )
{
dcmd_two( playerid, params );
.....
dcmd_two( playerid, params[] )
{
RunMyFunction();
.....
If you use command 'two' then the custom function will fire and if you use command 'one' it will fire command 'two' by itself and then 'two' will again fire the custom function or you could just C&P the code from 'one' into 'two' then they would both do the same thing.
Re: How to make this in dcmd? (Two commands for one function...) -
HB - 12.04.2009
Код:
dcmd_force(playerid,params[])
return dcmd_change(playerid,params);
Re: How to make this in dcmd? (Two commands for one function...) -
robanswe - 12.04.2009
Quote:
Originally Posted by иєσz
Код:
dcmd_force(playerid,params[])
return dcmd_change(playerid,params);
|
Tanks
Re: How to make this in dcmd? (Two commands for one function...) -
ICECOLDKILLAK8 - 12.04.2009
I have 2 defines for dcmd (dcmd and dcmd2),
I use dcmd2 like this,
pawn Код:
// Instead of
dcmd(command, 7, cmdtext);
// You can use
dcmd(command, 7, cmdtext, dcmd function to call);