[Help] undefined symbol "params"
#1

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

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

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

CMD:commandhere(playerid, params[])
Reply
#4

Are you trying to use a function or create a command?
Reply
#5

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

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

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

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

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


Forum Jump:


Users browsing this thread: 1 Guest(s)