SA-MP Forums Archive
[Help] undefined symbol "params" - 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)
+--- Thread: [Help] undefined symbol "params" (/showthread.php?tid=595218)



[Help] undefined symbol "params" - INKISICION - 29.11.2015

public OnPlayerSpawn(playerid)
{

cmd_mycommand(playerid, params);

return 1;
}

Error

error 017: undefined symbol "params"

using #pragma unused params

error 017: undefined symbol "params"
error 017: undefined symbol "params"



It appears twice



Re: [Help] undefined symbol "params" - RIDE2DAY - 29.11.2015

Dude params must be defined somewhere, try replacing params by "".
PHP код:
cmd_mycommand(playerid""); 
Regards.


Re: [Help] undefined symbol "params" - Jay_Dixon - 29.11.2015

gotta do it like this, or this is how I do it, and get no problem with it

CMD:commandhere(playerid, params[])


Re: [Help] undefined symbol "params" - Denying - 29.11.2015

Are you trying to use a function or create a command?


Respuesta: Re: [Help] undefined symbol "params" - INKISICION - 29.11.2015

Thanks to all

solved by RIDE2DAY +Rep


Quote:
Originally Posted by RIDE2DAY
Посмотреть сообщение
Dude params must be defined somewhere, try replacing params by "".
PHP код:
cmd_mycommand(playerid""); 
Regards.



Re: [Help] undefined symbol "params" - thefirestate - 29.11.2015

Just to point out that if the command doesn't require anything to be typed after it a.k.a params[] you can just ignore it example: CMD:lights(playerid) , this would properly do everything because /lights doesn't require params unless you script it to with something like /lightson, otherwise all you need is playerid to get the vehicle ID and then check the params.


Re: [Help] undefined symbol "params" - Sew_Sumi - 30.11.2015

Quote:
Originally Posted by thefirestate
Посмотреть сообщение
Just to point out that if the command doesn't require anything to be typed after it a.k.a params[] you can just ignore it example: CMD:lights(playerid) , this would properly do everything because /lights doesn't require params unless you script it to with something like /lightson, otherwise all you need is playerid to get the vehicle ID and then check the params.
^^ That and I seen last week that someone solved your issue, with putting params[] instead of just params.


Searching would be a wonderful thing.


Re: [Help] undefined symbol "params" - thefirestate - 30.11.2015

Quote:
Originally Posted by Sew_Sumi
Посмотреть сообщение
^^ That and I seen last week that someone solved your issue, with putting params[] instead of just params.


Searching would be a wonderful thing.
The last issue I had with params was maybe a month ago and it was most likely an isnull function that I needed to display the available section within /help. I never had problems with the params[] itself.


Re: [Help] undefined symbol "params" - Sew_Sumi - 30.11.2015

Quote:
Originally Posted by thefirestate
Посмотреть сообщение
The last issue I had with params was maybe a month ago and it was most likely an isnull function that I needed to display the available section within /help. I never had problems with the params[] itself.
Just last week or 2, someone came in with Undefined symbol params, and it turned out to be they'd missed the [] at the end.

It does affect it.


As you said, if it's not something that needs the extra params, like /lights, it's fine, and you can remove the params portion entirely, but if you're wanting anything that's after the command you have to use the params[]. e.g. /lights on, instead of just /lights.

If you use params it will error, because it's not what it's expecting... It needs the [] after.