How to make this in dcmd? (Two commands for one function...)
#1

How to make this in dcmd? (Two commands for one function...) if(strcmp(cmd, "/change", true) == 0 || strcmp(cmd, "/force", true) == 0)
Reply
#2

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.
Reply
#3

Код:
dcmd_force(playerid,params[])
return dcmd_change(playerid,params);
Reply
#4

Quote:
Originally Posted by иєσz
Код:
dcmd_force(playerid,params[])
return dcmd_change(playerid,params);
Tanks
Reply
#5

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);
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)