SA-MP Forums Archive
undefined symbol and symbol is assigned a value that is never used - 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)
+--- Thread: undefined symbol and symbol is assigned a value that is never used (/showthread.php?tid=429833)



undefined symbol and symbol is assigned a value that is never used - Proph3t - 11.04.2013

Hello and thanks for reading my help topic! i need help with this:

pawn Code:
forward FinishGame();
public FinishGame()
{
   if(teamTickets[0] > teamTickets[1])
   {
       winnerState = 1;
   }
   else if(teamTickets[0] < teamTickets[1])
   {
      winnerState = 2;
   }
   else winnerState = 0;
   new winning_Team = (( (winningState == 2) &&(winningState != 0)) ? 3 : 2);
   for(new i = 0; i < MAX_PLAYERS; i++)
   {
       if(IsPlayerConnected(i))
       {
           if(winnerState) {
           //Show a textdraw that winning_Team has won!
           }
           else {
           //Show a textdraw that it's a tie
           }
       }
   }
}
These are the errors i get:

C:\Users\Henk\Desktop\Battlefield\gamemodes\battle field.pwn(6965) : error 017: undefined symbol "winningState"
C:\Users\Henk\Desktop\Battlefield\gamemodes\battle field.pwn(6965) : warning 204: symbol is assigned a value that is never used: "winning_Team"


Re: undefined symbol and symbol is assigned a value that is never used - RenovanZ - 11.04.2013

Try to change
pawn Code:
new winning_Team = (( (winningState == 2) &&(winningState != 0)) ? 3 : 2);
to
pawn Code:
new winning_Team = (( (winnerState == 2) &&(winnerState != 0)) ? 3 : 2);
and, the second errors mean, variable winning_Team is never used, try to use it.


Re: undefined symbol and symbol is assigned a value that is never used - Proph3t - 11.04.2013

Thanks that helped!i fixed it!