if statement - invalid expression assumed 0
#3

Quote:
Originally Posted by Virtual1ty
Посмотреть сообщение
You forgot to close the outer opening round bracket :
Код:
	if(getCheckpointType(playerid) != CP_BurgerShotMain && getCheckpointType(playerid) != CP_CluckinBellMain &&
	getCheckpointType(playerid) != CP_Ammunation && getCheckpointType(playerid) != CP_GayDarMain &&
	getCheckpointType(playerid) != CP_ZeroMain && getCheckpointType(playerid) != CP_MistysMain &&
	getCheckpointType(playerid) != CP_GYM && getCheckpointType(playerid) != CP_School &&
	getCheckpointType(playerid) != CP_WangCars && getCheckpointType(playerid) != CP_Train &&
	getCheckpointType(playerid) != CP_Barbers && getCheckpointType(playerid) != CP_PizzaMain &&
	getCheckpointType(playerid) != CP_ZipMain && getCheckpointType(playerid) != CP_VictimMain &&
	getCheckpointType(playerid) != CP_BincoMain && getCheckpointType(playerid) != CP_CityHallMain &&
	getCheckpointType(playerid) != CP_Jizzys && getCheckpointType(playerid) != CP_Urban &&
	getCheckpointType(playerid) != CP_Church && getCheckpointType(playerid) != CP_DF &&
	getCheckpointType(playerid) != CP_Zombotech && getCheckpointType(playerid) != CP_Bank &&
	getCheckpointType(playerid) != CP_Mint) // you missed a ')' here
	{
	    SendClientMessage(playerid,COLOR_ERROR,"You are not in the checkpoint of anywhere you can rob.");
	    return 1;
	}
Also I suggest you save that "checkpoint type" in to a variable rather than calling the function "getCheckpointType" X times.
Like this:
Код:
	new cp_type = getCheckpointType(playerid);
	if (cp_type != CP_BurgerShotMain && cp_type != CP_CluckinBellMain &&
	    cp_type != CP_Ammunation && cp_type != CP_GayDarMain &&
	    cp_type != CP_ZeroMain && cp_type != CP_MistysMain &&
	    cp_type != CP_GYM && cp_type != CP_School &&
	    cp_type != CP_WangCars && cp_type != CP_Train &&
	    cp_type != CP_Barbers && cp_type != CP_PizzaMain &&
	    cp_type != CP_ZipMain && cp_type != CP_VictimMain &&
	    cp_type != CP_BincoMain && cp_type != CP_CityHallMain &&
	    cp_type != CP_Jizzys && cp_type != CP_Urban &&
	    cp_type != CP_Church && cp_type != CP_DF &&
	    cp_type != CP_Zombotech && cp_type != CP_Bank &&
	    cp_type != CP_Mint)
	{
	    SendClientMessage(playerid,COLOR_ERROR,"You are not in the checkpoint of anywhere you can rob.");
	    return 1;
	}
Thank you, that fixed the problem.
Reply


Messages In This Thread
if statement - invalid expression assumed 0 - by NoahF - 02.07.2015, 12:44
Re: if statement - invalid expression assumed 0 - by Virtual1ty - 02.07.2015, 13:03
Re: if statement - invalid expression assumed 0 - by NoahF - 02.07.2015, 13:45
Re: if statement - invalid expression assumed 0 - by Suicidal.Banana - 02.07.2015, 14:13
Re: if statement - invalid expression assumed 0 - by Vince - 02.07.2015, 14:23

Forum Jump:


Users browsing this thread: 1 Guest(s)