Help :s - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Help :s (
/showthread.php?tid=253111)
Help :s -
[KO]KillerThriller - 04.05.2011
Even if the vehicleid is 100 of health it sets the textdraw string to "wrecked" why?
pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER || GetPlayerState(playerid) == PLAYER_STATE_PASSENGER)
{
new Float:health;
if(GetVehicleHealth(GetPlayerVehicleID(playerid),health) <= 100)
{
TextDrawSetString(Vehstate[playerid],"~g~~h~State: ~y~~h~Exellente");
}
if(GetVehicleHealth(GetPlayerVehicleID(playerid),health) <= 90)
{
TextDrawSetString(Vehstate[playerid],"~g~~h~State: ~y~~h~Good");
}
if(GetVehicleHealth(GetPlayerVehicleID(playerid),health) <= 40)
{
TextDrawSetString(Vehstate[playerid],"~g~~h~State: ~y~~h~Poor");
}
if(GetVehicleHealth(GetPlayerVehicleID(playerid),health) <= 10)
{
TextDrawSetString(Vehstate[playerid],"~g~~h~State: ~y~~h~Wrecked");
}
TextDrawShowForPlayer(playerid,fueltd[playerid]);
TextDrawShowForPlayer(playerid,speedo[playerid]);
TextDrawShowForPlayer(playerid,Vehstate[playerid]);
}
else
{
TextDrawShowForPlayer(playerid,Vehstate[playerid]);
TextDrawHideForPlayer(playerid,fueltd[playerid]);
TextDrawHideForPlayer(playerid,speedo[playerid]);
}
return 1;
}
Re: Help :s -
MadeMan - 04.05.2011
Max. vehicle health is 1000.
Re: Help :s -
park4bmx - 04.05.2011
Because u do
<=100 that means from 100 down and then u do
<=90 this would confuse the script a bit so do it like
>90 && <=100
And then for 90 u would do
>80 && <=90
And u do know that max vehicle health is 1000 becouse if it is at 100 it would be on fire D