Lose HP when car crashe
#1

I'm trying to do a system to when player crashes the car he loses life...
But i'm failed

What i tried?
PHP код:
public OnDynamicVehDamageStatusUpdate(vehicleidplayerid) {
    
// comp 1
    
GetDynamicVehicleHealth(vehicleidvHPcintoA[vehicleid]);
    if(
vHPcintoA[vehicleid] < vHPcintoB[vehicleid])
    {
        
// losing life
        
new Float:danoplayerbatida = (vHPcintoB[vehicleid] - vHPcintoA[vehicleid]) / 100;
        
vida[playerid] -= danoplayerbatida;
        new 
dmgstring[20];
        
format(dmgstringsizeof(dmgstring), "~r~%i.0"danoplayerbatida );
        
GameTextForPlayer(playeriddmgstring10003);
    }
    
// comp 2
    
GetDynamicVehicleHealth(vehicleidvHPcintoB[vehicleid]);

So if player loses 500 vehicle hp, vida[playerid] -= 50;
But its not happen...

GameTextForPlayer is showing a value like:
Something like 106150650

And nothing happen...
Reply


Messages In This Thread
Lose HP when car crashe - by binnyl - 14.10.2017, 22:51
Re: Lose HP when car crashe - by Meller - 15.10.2017, 00:41
Re: Lose HP when car crashe - by binnyl - 17.10.2017, 02:45
Re: Lose HP when car crashe - by Zeth - 17.10.2017, 06:27
Re: Lose HP when car crashe - by TomRedlake - 17.10.2017, 10:21

Forum Jump:


Users browsing this thread: 1 Guest(s)