SpeedoMeter Help
#6

pawn Код:
public Speedo()
{
    new Float:Speedo_HP;

    for(new i=0;i<MAX_PLAYERS;i++)
    {
        if(IsPlayerInAnyVehicle(i))
        {
            new vehicle = GetPlayerVehicleID(i);
            GetVehicleHealth(vehicle, Speedo_HP);
            new Float:X, Float:Y, Float:Z, Float:Sp;
            GetVehicleVelocity(vehicle, X, Y, Z);
            Sp = floatmul(floatsqroot(floatadd(floatadd(floatpower(X, 2), floatpower(Y, 2)),  floatpower(Z, 2))), 100.0);
            Speed[i]=floatround(floatdiv(Sp, 0.75), floatround_floor);

            if(SpeedoON[i] == 0)
            {
                TextDrawShowForPlayer(i, Speedd[i]);
                TextDrawShowForPlayer(i, Vehicle[i]);
                TextDrawShowForPlayer(i, Health[i]);
                SpeedoON[i] = 1;
            }
            new string[128];
            format(string,sizeof(string),"Masina: %s",VehicleNames[GetVehicleModel(vehicle)-400]);
            TextDrawSetString(Vehicle[i], string);
            format(string,sizeof(string),"Viteza: %dmp/h",Speed[i]);
            TextDrawSetString(Speedd[i], string);
            format(string,sizeof(string),"Viata: %.2f", Speedo_HP);
            TextDrawSetString(Health[i], string);
        }
        else if(SpeedoON[i] == 1)
        {
            TextDrawHideForPlayer(i, Speedd[i]);
            TextDrawHideForPlayer(i, Vehicle[i]);
            TextDrawHideForPlayer(i, Health[i]);
            SpeedoON[i] = 0;
        }
    }
}
Also, you don't need to create 3 strings.
Reply


Messages In This Thread
SpeedoMeter Help - by Proteine - 15.10.2010, 13:54
Re: SpeedoMeter Help - by Cameltoe - 15.10.2010, 14:07
Re: SpeedoMeter Help - by Proteine - 15.10.2010, 15:17
Re: SpeedoMeter Help - by Cameltoe - 15.10.2010, 15:29
Re: SpeedoMeter Help - by Proteine - 15.10.2010, 15:32
Re: SpeedoMeter Help - by MadeMan - 15.10.2010, 15:34
Re: SpeedoMeter Help - by Proteine - 15.10.2010, 15:38

Forum Jump:


Users browsing this thread: 1 Guest(s)