Vehicle &Player healt
#1

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 -.-
Reply
#2

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.
Reply
#3

hmm..
error 017: undefined symbol "health"
Reply
#4

Sorry type it also :
new Float:health;
Reply
#5

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"
Reply
#6

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

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

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

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)