if statement
#1

Hi, I have normal vehicles and dynamic vehicles (they are owned by players only) in my gamemode. Their windows can be rolled down. But only dynamic vehicles' window can be broken. So what I want to do is when player is in a vehicle and the vehicle's window is broken or they are rolled down then send a message to everyone nearby, else send a message only to the passengers. I have this:
Код:
if (!IsBike(vehicleid) && !VehicleInfo[vehicleid][VehicleWindowDown][0] && !VehicleInfo[vehicleid][VehicleWindowDown][1] && !VehicleInfo[vehicleid][VehicleWindowDown][2] && !VehicleInfo[vehicleid][VehicleWindowDown][3] && (GetVehicleDynamicID(vehicleid) != -1 && !DynamicVehicleInfo[GetVehicleDynamicID(vehicleid)][VehicleWindowBroken]))
{
	for (new i, j = GetPlayerPoolSize(); i <= j; i++) if (IsPlayerConnected(i) && GetPlayerVehicleID(i) == vehicleid) SendClientMessageEx(i, COLOR_GOLD, "(vehicle) %s says: %s", GetName(playerid, 0), text);
	return 0;
}
and it works well on dynamic vehicles, the message is sent to all passengers if the window is not broken or the windows are closed, but when you are in a normal vehicle then it sends a message to all players nearby even though the windows are closed. I tried changing the if statement, but it doesn't work how I want it to. Do I need to break it into two pieces to make it work?
Reply


Messages In This Thread
if statement - by GoldenLion - 27.12.2016, 16:12
Re: if statement - by NaS - 27.12.2016, 16:41
Re: if statement - by GoldenLion - 27.12.2016, 19:13
Re: if statement - by NaS - 27.12.2016, 19:17
Re: if statement - by GoldenLion - 27.12.2016, 19:19
Re: if statement - by Konstantinos - 27.12.2016, 19:28

Forum Jump:


Users browsing this thread: 2 Guest(s)