17.03.2015, 01:41
can someone teach me type, when the player takes damage, it starts bleeding? I tried to make a code already in "OnPlayerTakeDamage" but my player taking damage while riding ...
can someone teach me type, when the player takes damage, it starts bleeding? I tried to make a code already in "OnPlayerTakeDamage" but my player taking damage while riding ...
|
new Float:old_h[MAX_PLAYERS]; //Write it @the top public OnPlayerUpdate(playerid) { new Float:h; GetPlayerHealth(playerid,h); if(h < old_h[playerid]) { old_h[playerid] = h; //Here start the Blood! } else if(h != old_h[playerid]) old_h[playerid] = h; }
public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid, bodypart)
{
SetPlayerAttachedObject(playerid, ...);//attach a bleeding type object to player
}
public OnPlayerSpawn(playerid)
{
RemovePlayerAttachedObject(playerid, ...);
}
@Kaliber: your code dont make sense. OnPlayerUpdate is quiet fast and not work in regular intervals.
|
His code is absolutely correct, OnPlayerTakeDamage is called when the player takes damage, why would you need to detect it manually in OnPlayerUpdate?
I tried to make a code already in "OnPlayerTakeDamage" but my player taking damage while riding ...
You must talk...oh jesus...but u didn't understand my Code...
Код:
His code is absolutely correct, OnPlayerTakeDamage is called when the player takes damage, why would you need to detect it manually in OnPlayerUpdate? Код:
I tried to make a code already in "OnPlayerTakeDamage" but my player taking damage while riding ... |
public OnPlayerTakeDamage(...)
{
if(IsPlayerInAnyVehicle(playerid))
{
return 0;
}
return 1;
}
You must talk...oh jesus...but u didn't understand my Code...
Код:
His code is absolutely correct, OnPlayerTakeDamage is called when the player takes damage, why would you need to detect it manually in OnPlayerUpdate? Код:
I tried to make a code already in "OnPlayerTakeDamage" but my player taking damage while riding ... |