19.02.2019, 17:55
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
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 vehicleid, Float:health;
new engine, lights, alarm, doors, bonnet, boot, objective;
new fstring[32], string[512];
for(new i=0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) && IsPlayerInAnyVehicle(i))
{
vehicleid = GetPlayerVehicleID(i);
GetVehicleHealth(vehicleid, health);
GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
string = "~b~~h~vehicle: ~w~";
strcat(string, VehicleNames[GetVehicleModel(vehicleid)-400], sizeof(string));
strcat(string, "~n~~b~~h~gps: ~w~", sizeof(string));
strcat(string, GetPlayer3DZone(i), sizeof(string));
strcat(string, "~n~~b~~h~health: ~g~", sizeof(string));
fstring = "iiiiiiiiii";
if(health > 1000.0) strins(fstring, "~r~", 10, sizeof(fstring));
else if(health < 0.0) strins(fstring, "~r~", 0, sizeof(fstring));
else strins(fstring, "~r~", floatround(health/100.0), sizeof(fstring));
strcat(string, fstring, sizeof(string));
strcat(string, " ~b~~h~fuel: ~g~", sizeof(string));
fstring = "iiiiiiiiii";
if(Fuel[vehicleid] > 100.0) strins(fstring, "~r~", 10, sizeof(fstring));
else if(Fuel[vehicleid] < 0.0) strins(fstring, "~r~", 0, sizeof(fstring));
else strins(fstring, "~r~", floatround(Fuel[vehicleid]/10.0), sizeof(fstring));
strcat(string, fstring, sizeof(string));
strcat(string, " ~b~~h~", sizeof(string));
if(GetPVarInt(i, "Speedo")) format(fstring,sizeof(fstring),"mph: ~w~%d", GetPlayerSpeed(i, false));
else format(fstring,sizeof(fstring),"kph: ~w~%d", GetPlayerSpeed(i, true));
strcat(string, fstring, sizeof(string));
strcat(string, "~n~~b~~h~engine: ", sizeof(string));
if(engine == 1) strcat(string, "~g~on", sizeof(string));
else strcat(string, "~r~off", sizeof(string));
strcat(string, " ~b~~h~alarm: ", sizeof(string));
if(VehicleSecurity[vehicleid] == 1) strcat(string, "~g~on", sizeof(string));
else strcat(string, "~r~off", sizeof(string));
strcat(string, " ~b~~h~doors: ", sizeof(string));
if(doors == 1) strcat(string, "~r~locked", sizeof(string));
else strcat(string, "~g~unlocked", sizeof(string));
TextDrawSetString(SpeedoText[i], string);
}
}
}