SA-MP Forums Archive
Vehicle &Player healt - 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)
+--- Thread: Vehicle &Player healt (/showthread.php?tid=457923)



Vehicle &Player healt - Baumann - 14.08.2013

Hey i need help with vehicle and player healt .
If i go into car then if i crash with the car then my hp goes down .and my hp bar shows car hp ..
I dont want if my car hits wall then my hp goes to down -.-


Re: Vehicle &Player healt - PrinceKumar - 14.08.2013

I never tried this thing but i m also thinking is it possible .. Try it once, use it under playerenterinvehicle or playerstatechange
pawn Код:
new veh = GetPlayerVehicleID(playerid);
new vHp = GetVehicleHealth(veh, health);
SetPlayerHealth(playerid, vHp);
not sure but try it.


Re: Vehicle &Player healt - Baumann - 14.08.2013

hmm..
error 017: undefined symbol "health"


Re: Vehicle &Player healt - PrinceKumar - 14.08.2013

Sorry type it also :
new Float:health;


Re: Vehicle &Player healt - Baumann - 14.08.2013

public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
Quote:

new veh = GetPlayerVehicleID(playerid);
new vHp = GetVehicleHealth(veh, health);
SetPlayerHealth(playerid, vHp);
new Float:health;

error 017: undefined symbol "health"


Re: Vehicle &Player healt - PrinceKumar - 14.08.2013

pawn Код:
new Float:health;
new veh = GetPlayerVehicleID(playerid);
new vHp = GetVehicleHealth(veh, health);
SetPlayerHealth(playerid, vHp);



Re: Vehicle &Player healt - Baumann - 14.08.2013

no errors now , but i tested it , and still goes hp down in my hp bar if i hit with car somewhere


Re: Vehicle &Player healt - Baumann - 14.08.2013

my hp bar like shows cars hp
and if i enter the vehicle i die automatically if i enter .


Re: Vehicle &Player healt - PrinceKumar - 14.08.2013

Sorry i think u want to set ur hp with vehicle hp , but i think its not possible coz how a compiler get to know that u r going to hit with wall.