question -
Deadpoop - 31.03.2018
why most people code like this
PHP код:
CMD:x(playerid, params[])
{
new target, str[x];
//some code
return 1;
}
when they can code like this
PHP код:
CMD:x(playerid, str[], target)
{
//some code
return 1;
}
Re: question -
Kaperstone - 31.03.2018
because you don't always target a player and param are really just parameters.
it is a lot better that way because using this and sscanf you can have many parameters of different types in unordered way.
/command [string] [int] [char] [float]
/command [float] [string] [int]
etc.
sscanf just slices your string to parts that you can parse.
Re: question -
Gammix - 31.03.2018
I know the second one won't work properly as ZCMD only parses the command name and the rest goes into "params".
So you simply just changed "params" to "str" which is not wrong but "target" will simply hold 0 always.