16.01.2015, 01:17
SO. I'M PRETTY MAD AT MYSELF RIGHT NOW.
I've scripted something that's SO easy, a toddler could do it.
This is supposed to STALL the vehicle, after it reaches under 251.0 health, and set it to 350.0
HOWEVER
Whenever you get into a vehicle, it automatically sets it to 350.0 but it shouldn't.
It should only do that if the health gets lower or equal to 251.0. However when it gets in it automatically sets it to 350.0?
< = less than right?
Anyway, help.
+REP
I've scripted something that's SO easy, a toddler could do it.
pawn Код:
if(IsPlayerInAnyVehicle(i) && GetPlayerState(i) == PLAYER_STATE_DRIVER)
{
new carid = GetPlayerVehicleID(i), string[128];
new VehHealth;
if(VehHealth <= 251.0)
{
SetVehicleHealth(carid, 350.0);
format(string, sizeof(string), "** The vehicle engine stalls (( %s )).", GetName(i));
NearByMessage(i, SCRIPTPURPLE, string);
new engine,lights,alarm,doors,bonnet,boot,objective;
GetVehicleParamsEx(carid,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(carid,VEHICLE_PARAMS_OFF,lights,alarm,doors,bonnet,boot,objective);
}
}
HOWEVER
Whenever you get into a vehicle, it automatically sets it to 350.0 but it shouldn't.
It should only do that if the health gets lower or equal to 251.0. However when it gets in it automatically sets it to 350.0?
< = less than right?
Anyway, help.
+REP