03.04.2016, 16:07
Hello,
i have a problem with my hud.
It shows up perfectly fine, but EVERYONE gets this hud, but we only need to see our hud the vehicle you are in.
How do you do this?
i have a problem with my hud.
It shows up perfectly fine, but EVERYONE gets this hud, but we only need to see our hud the vehicle you are in.
How do you do this?
pawn Код:
GetPlayerPos(i, x, y, z);
distance = floatsqroot(floatpower(floatabs(floatsub(x,SavePlayerPos[i][LastX])),2)+floatpower(floatabs(floatsub(y,SavePlayerPos[i][LastY])),2)+floatpower(floatabs(floatsub(z,SavePlayerPos[i][LastZ])),2));
value = floatround(distance * 5600);
new Float:tmph;
GetVehicleHealth(GetPlayerVehicleID(i), tmph);
//format(string, sizeof(string), "~r~Health:~w~ %.0f%% ~n~~r~Time:~w~ %02d:%02d~n~~r~Weapon:~w~%s~n~~r~Money: ~w~пїЅ%s~n~~r~Vehicle: ~w~%s~n~~r~Fuel:~w~ %d%%~n~~r~Speed: ~w~%d", aWeaponNames[GetPlayerWeapon(i)], number_format(PlayerTemp[i][sm]), GetVehicleName(GetPlayerVehicleID(i)), Gas[GetPlayerVehicleID(i)], floatround(value/600));
format(string, sizeof(string), "~r~Speed: ~w~%d KM/H~n~~r~Fuel: ~w~%d%%~n~~r~Health: ~w~%d%", floatround(value/600), Gas[GetPlayerVehicleID(i)], floatround(floatdiv(tmph,10)));
TextDrawSetString(PlayerTemp[i][Status], string);
if(Gas[GetPlayerVehicleID(i)] <= 10 && IsPlayerDriver(i)) TDWarning(i, "you are running out of fuel!", 1400);
if(Gas[GetPlayerVehicleID(i)] <= 0 && IsPlayerDriver(i)) RemovePlayerFromVehicle(i), SendClientInfo(i, "No fuel!");
SavePlayerPos[i][LastX] = x;
SavePlayerPos[i][LastY] = y;
SavePlayerPos[i][LastZ] = z;