Posts: 106
Threads: 24
Joined: Jan 2015
Reputation:
0
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
Posts: 249
Threads: 61
Joined: Aug 2012
Reputation:
0
gotta do it like this, or this is how I do it, and get no problem with it
CMD:commandhere(playerid, params[])
Posts: 526
Threads: 52
Joined: Feb 2013
Reputation:
0
Are you trying to use a function or create a command?
Posts: 170
Threads: 7
Joined: Sep 2014
Reputation:
0
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.
Posts: 6,242
Threads: 8
Joined: Jun 2008
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.
Posts: 6,242
Threads: 8
Joined: Jun 2008
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.