Speedometer
#1

Hello.

I downloaded this FS https://sampforum.blast.hk/showthread.php?tid=276887 .
But I want to change the speedometer to textdraw, i hava made my own textdraws, but I dont understand how i can change it.

Here are the codes From this FS

PHP код:
public Speedometer()
{
    new 
vehicleidFloat:health;
    new 
enginelightsalarmdoorsbonnetbootobjective;
    new 
fstring[32], string[512];
    for(new 
i=0MAX_PLAYERSi++)
    {
        if(
IsPlayerConnected(i) && IsPlayerInAnyVehicle(i))
        {
            
vehicleid GetPlayerVehicleID(i);
            
GetVehicleHealth(vehicleidhealth);
            
GetVehicleParamsEx(vehicleidenginelightsalarmdoorsbonnetbootobjective);
            
            
string "~b~~h~vehicle: ~w~";
            
strcat(stringVehicleNames[GetVehicleModel(vehicleid)-400], sizeof(string));
            
            
strcat(string"~n~~b~~h~gps: ~w~"sizeof(string));
            
strcat(stringGetPlayer3DZone(i), sizeof(string));
            
            
strcat(string"~n~~b~~h~health: ~g~"sizeof(string));
            
fstring "iiiiiiiiii";
            if(
health 1000.0strins(fstring"~r~"10sizeof(fstring));
            else if(
health 0.0strins(fstring"~r~"0sizeof(fstring));
            else 
strins(fstring"~r~"floatround(health/100.0), sizeof(fstring));
            
strcat(stringfstringsizeof(string));
            
            
strcat(string"        ~b~~h~fuel: ~g~"sizeof(string));
            
fstring "iiiiiiiiii";
            if(
Fuel[vehicleid] > 100.0strins(fstring"~r~"10sizeof(fstring));
            else if(
Fuel[vehicleid] < 0.0strins(fstring"~r~"0sizeof(fstring));
            else 
strins(fstring"~r~"floatround(Fuel[vehicleid]/10.0), sizeof(fstring));
            
strcat(stringfstringsizeof(string));
            
            
strcat(string"        ~b~~h~"sizeof(string));
            if(
GetPVarInt(i"Speedo")) format(fstring,sizeof(fstring),"mph: ~w~%d"GetPlayerSpeed(ifalse));
            else 
format(fstring,sizeof(fstring),"kph: ~w~%d"GetPlayerSpeed(itrue));
            
strcat(stringfstringsizeof(string));
            
            
strcat(string"~n~~b~~h~engine: "sizeof(string));
            if(
engine == 1strcat(string"~g~on"sizeof(string));
            else 
strcat(string"~r~off"sizeof(string));
            
            
strcat(string"        ~b~~h~alarm: "sizeof(string));
            if(
VehicleSecurity[vehicleid] == 1strcat(string"~g~on"sizeof(string));
            else 
strcat(string"~r~off"sizeof(string));
            
            
strcat(string"        ~b~~h~doors: "sizeof(string));
            if(
doors == 1strcat(string"~r~locked"sizeof(string));
            else 
strcat(string"~g~unlocked"sizeof(string));
            
            
TextDrawSetString(SpeedoText[i], string);
        }
    }

Reply
#2

it's easier if u made ur own from scratch
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)