27.12.2016, 16:12
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:
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?
Код:
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; }