14.10.2017, 22:51
I'm trying to do a system to when player crashes the car he loses life...
But i'm failed
What i tried?
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...
But i'm failed
What i tried?
PHP код:
public OnDynamicVehDamageStatusUpdate(vehicleid, playerid) {
// comp 1
GetDynamicVehicleHealth(vehicleid, vHPcintoA[vehicleid]);
if(vHPcintoA[vehicleid] < vHPcintoB[vehicleid])
{
// losing life
new Float:danoplayerbatida = (vHPcintoB[vehicleid] - vHPcintoA[vehicleid]) / 100;
vida[playerid] -= danoplayerbatida;
new dmgstring[20];
format(dmgstring, sizeof(dmgstring), "~r~%i.0", danoplayerbatida );
GameTextForPlayer(playerid, dmgstring, 1000, 3);
}
// comp 2
GetDynamicVehicleHealth(vehicleid, vHPcintoB[vehicleid]);
}
But its not happen...
GameTextForPlayer is showing a value like:
Something like 106150650
And nothing happen...