"Undefined symbol "bagid" "
#5

Quote:
Originally Posted by Yashas
Посмотреть сообщение
You whole code is completely.... terribly.... wrong.How can you carry out operations outside a function block?You need to first put those assignments and format,etc inside a function block where it can get executed.

Does that in...OnPlayerDeath mean its inside the callback { }??Or that's a comment in your code?
His question is about why 'bagid' isn't working, nothing else.

Quote:
Originally Posted by S4t3K
Посмотреть сообщение
I know it

But MAX_BAGS should work like MAX_PLAYERS no ?
So bagid is the same as playerid, but for the bags, and it not depends of players, but of bags, isn't ?

I just ask questions, I don't know how to solve this problem, and how does it was created :3
Let me explain why 'bagid' isn't and 'playerid' is working;
'bagid' isn't working because you do not have any variable named 'bagid' holding any value (The bagid), you should code it so you'll have a function which gets the bagid you need or something, then you COULD do
pawn Код:
#define bagid return GetBagID();
and then you could use 'bagid' as you are doing, currently it just doesn't exist. You could more easily do this;
pawn Код:
new bagid = -1;
*code to get the bagid you need*
*use bagid where ever you want (As long as the variable is in the same function/callback/whatsoever)*
To get back to the point, the reason why 'playerid' is working is because when the command, or where ever you are using the playerid should have 'playerid' as argument, for example
pawn Код:
OnPlayerCommandText(playerid, cmdtext[])
{
// code
}

or ZCMD:

CMD:command(playerid, params[])
{
// code
}
You see how they both have 'playerid' as argument? Now well, that's the reason why you don't have to get the playerid yourself, the explanation is quite messy (And pobably also shit, lol) but I have no clue how to explain it better!

Best regards,
Jesse
Reply


Messages In This Thread
"Undefined symbol "bagid" " - by S4t3K - 14.01.2014, 10:39
Re: "Undefined symbol "bagid" " - by newbie scripter - 14.01.2014, 11:03
Re : "Undefined symbol "bagid" " - by S4t3K - 14.01.2014, 11:13
Re: "Undefined symbol "bagid" " - by Yashas - 14.01.2014, 12:09
Re: Re : "Undefined symbol "bagid" " - by jessejanssen - 14.01.2014, 12:21
Re: "Undefined symbol "bagid" " - by EmilLykke - 14.01.2014, 13:15
Re: "Undefined symbol "bagid" " - by ikey07 - 14.01.2014, 13:26
Re : "Undefined symbol "bagid" " - by S4t3K - 14.01.2014, 16:36

Forum Jump:


Users browsing this thread: 1 Guest(s)