Few Warnings When Comiling
#1

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

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

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?
Reply
#4

The code of the define?
Reply
#5

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


Forum Jump:


Users browsing this thread: 3 Guest(s)