possibly unintended assignment
#1

Код:
C:\Users\ABC\Desktop\0.3x Package\gamemodes\Prison.pwn(1566) : warning 211: possibly unintended assignment
C:\Users\ABC\Desktop\0.3x Package\gamemodes\Prison.pwn(1599) : warning 204: symbol is assigned a value that is never used: "prison"
What I am doing is when a player registers an ID will be assigned to him and will appear as a textlabel on spawn, I've assigned a random number from 0 to 100 and then it worked successfully, now I turned into the label creation, variables etc, I've used the variable prison and prisontext, OnPlayerSpawn it checks if the variable "PRISON" = 0? then it creates the label if not, do nothing the error is above ^^ also why it's saying that's the variable is never used? I am confused lol.

Код:
	if(prison = 0)
	{
		prisontext = Create3DTextLabel(PlayerInfo[playerid][pPrison],LIGHTGREEN, 30.0, 40.0, 50.0, 40.0, 0);
		Attach3DTextLabelToPlayer(prisontext, playerid, 0.0, 0.0, 0.7);
		prison = 1;
	}
	else
	{
	    // nothing
	}
Reply
#2

You do not want to assign, but check if it's equal; therebefore you need to use ==

Either:
pawn Код:
if(prison == 0)
or:
pawn Код:
if(!prison)
Reply
#3

Ooh! my bad lol, thank you x_x
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)