well my onplayerupdate could be better, but i dont really know how :P, can you help?
pawn Код:
public OnPlayerUpdate(playerid)
{
if(GetPlayerState(pid) == 2)
{
new id = GetPlayerVehicleID(pid);
new engine, lights, alarm, doors, bonnet, boot, objective;
GetVehicleParamsEx(id, engine, lights, alarm, doors, bonnet, boot, objective);
if(seatbelt[playerid] == 0)
{
PlayerTextDrawShow(playerid, fasten);
PlayerTextDrawShow(playerid, belt);
}
if(engine == 0)
{
PlayerTextDrawShow(playerid, check);
PlayerTextDrawShow(playerid, engine1);
}
if(engine == 1)
{
PlayerTextDrawHide(playerid, check);
PlayerTextDrawHide(playerid, engine1);
}
if(0 < VehicleInfo[id][vFuel] <= 10)
{
PlayerTextDrawSetString(playerid, fuellevel, "l");
return 1;
}
if(10 < VehicleInfo[id][vFuel] <= 20)
{
PlayerTextDrawSetString(playerid, fuellevel, "ll");
return 1;
}
if(20 < VehicleInfo[id][vFuel] <= 30)
{
PlayerTextDrawSetString(playerid, fuellevel, "lll");
return 1;
}
if(30 < VehicleInfo[id][vFuel] <= 40)
{
PlayerTextDrawSetString(playerid, fuellevel, "llll");
return 1;
}
if(40 < VehicleInfo[id][vFuel] <= 50)
{
PlayerTextDrawSetString(playerid, fuellevel, "lllll");
return 1;
}
if(50 < VehicleInfo[id][vFuel] <= 60)
{
PlayerTextDrawSetString(playerid, fuellevel, "llllll");
return 1;
}
if(60 < VehicleInfo[id][vFuel] <= 70)
{
PlayerTextDrawSetString(playerid, fuellevel, "lllllll");
return 1;
}
if(70 < VehicleInfo[id][vFuel] <= 80)
{
PlayerTextDrawSetString(playerid, fuellevel, "llllllll");
return 1;
}
if(80 < VehicleInfo[id][vFuel] <= 90)
{
PlayerTextDrawSetString(playerid, fuellevel, "lllllllll");
return 1;
}
if(90 < VehicleInfo[id][vFuel] <= 100)
{
PlayerTextDrawSetString(playerid, fuellevel, "llllllllll");
return 1;
}
return 1;
}
return 1;
}