Problem with fuel system
#1

So..I wanna if player is on bike to see only "Speed: 40 km/h".Here is my code:

pawn Код:
public Speedupdate()
{
    for(new i = 0;i<MAX_PLAYERS;i++)
    {
        if(IsPlayerConnected(i) && IsPlayerInAnyVehicle(i))
        {
            new Float:x,Float:y,Float:z,Float:hp,string[24],vehicleid = GetPlayerVehicleID(i);
            TextDrawShowForPlayer(i,speed[i]);
            TextDrawShowForPlayer(i,health[i]);
            TextDrawShowForPlayer(i,fuel[i]);
            GetVehicleVelocity(vehicleid,x,y,z);
            GetVehicleHealth(vehicleid,hp);
            format(string,sizeof(string),"~w~ Speed: %d km/h",floatround(floatsqroot(((x*x)+(y*y))+(z*z))*181.5));
            TextDrawSetString(speed[i],string);
            if(GetVehicleModel(vehicleid) != 509 || GetVehicleModel(vehicleid) != 510 || GetVehicleModel(vehicleid) != 481)
            {
                format(string,sizeof(string),"~g~ Health: %d",floatround(hp));
                TextDrawSetString(health[i],string);
                format(string,sizeof(string),"~r~ Fuel: %dL",VehicleFuel[vehicleid]);
                TextDrawSetString(fuel[i],string);
            }
        }
        if(!IsPlayerInAnyVehicle(i))
        {
            TextDrawHideForPlayer(i,speed[i]);
            TextDrawHideForPlayer(i,health[i]);
            TextDrawHideForPlayer(i,fuel[i]);
        }
    }
}
Reply


Messages In This Thread
Problem with fuel system - by MrTinder - 09.11.2013, 17:53
Re: Problem with fuel system - by Loot - 09.11.2013, 18:02
Re: Problem with fuel system - by MrTinder - 09.11.2013, 18:17

Forum Jump:


Users browsing this thread: 1 Guest(s)