12.09.2013, 11:54
hi guys,
Iv added a fuel system and i wanted it to send a message to the player saying you are out of fuel. but it only sends to player id 0 no matter who it is who runs out of fuel
Iv added a fuel system and i wanted it to send a message to the player saying you are out of fuel. but it only sends to player id 0 no matter who it is who runs out of fuel
pawn Код:
forward FuelUpdate(playerid);
public FuelUpdate(playerid)
{
for(new i = 1;i<MAX_VEHICLES;i++)
{
if(GetVehicleModel(i))
{
new engine,lights,alarm,doors,bonnet,boot,objective;
GetVehicleParamsEx(i,engine,lights,alarm,doors,bonnet,boot,objective);
if(engine == 1)
{
if(VehicleFuel[i] > 0) VehicleFuel[i]--;
else
{
SetVehicleParamsEx(i,0,lights,alarm,doors,bonnet,boot,objective);
SendClientMessage(playerid, -1, "Engine Stalled.");
SendClientMessage(playerid, -1, "You are out of fuel.");
}
}
}
}
}