DCMD question
#1

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?
Reply
#2

This should work:

pawn Code:
dcmd_ooc(playerid, params[])
{
  // stuff in here
  return 1;
}

dcmd_o(playerid, params[])
{
  dcmd_ooc(playerid, params);
  return 1;
}
Reply
#3

thanks
haha very nice solution
Reply
#4

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

yeah off course
they are just like a regular functions
Reply
#6

Quote:
Originally Posted by BSMan
yeah off course
they are just like a regular functions
They're functions
Reply
#7

:S
thats what i said
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)