Few Warnings When Comiling - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Few Warnings When Comiling (
/showthread.php?tid=196402)
Few Warnings When Comiling -
lewismichaelbbc - 05.12.2010
Here are the errors
pawn Код:
Line(24099) : error 017: undefined symbol "SBizzInfo"
Line(24099) : warning 215: expression has no effect
Line(24099) : error 001: expected token: ";", but found "]"
Line(24099) : error 029: invalid expression, assumed zero
Line(24099) : fatal error 107: too many error messages on one line
Here is line 24099 -
pawn Код:
if(PlayerInfo[playerid][pPbiskey] >= 100 && strcmp(sendername, SBizzInfo[PlayerInfo[playerid][pPbiskey]-100][sbOwner], true) == 0)
How can i fix this?
Thanks for the help.
Re: Few Warnings When Comiling -
JaTochNietDan - 05.12.2010
It means what it says, the variable SBizzInfo is not defined, so you need to add it to your script with the required information in it for that if statement to work as intended.
Re: Few Warnings When Comiling -
lewismichaelbbc - 05.12.2010
Quote:
It means what it says, the variable SBizzInfo is not defined, so you need to add it to your script with the required information in it for that if statement to work as intended.
|
Ok, i defined it and i now get this error:
pawn Код:
Line(24103) : error 028: invalid subscript (not an array or too many subscripts): "SBizzInfo"
What should i do now?
Re: Few Warnings When Comiling -
[MWR]Blood - 05.12.2010
The code of the define?
Re: Few Warnings When Comiling -
Rachael - 05.12.2010
Without looking for errors in the syntax..
I think you should split the line up into at least two stages.
I Think the script will try to evaluate both parts of the if statement at the same time, therefore if the first value is not true, it will still try to evaluate the second, causing problems when it tried to read from the array ( position -100 )
Furthermore ( I'm not sure about this ) I think strcmp might return true if the array you are comparing it to is empty, so you might want to throw a line in there to check for that.
pawn Код:
if(PlayerInfo[playerid][pPbiskey] >= 100 )
{
new owner[24];
strmid(owner,SBizzInfo[PlayerInfo[playerid][pPbiskey]-100][sbOwner],0,24,24);
if(strlen(owner))
{
if(!strcmp(sendername,owner,true))
{
// rest of stuff here
This is just based on my experience of things that do and don't work in pawn, and is not nescessarilly the best way to do it.