11.07.2015, 14:02
Quote:
You've got this all wrong...
1. Never call DamagePlayer in OnPlayerDamage. 2. OnPlayerDeath IS called. You may have thought it wasn't because with this include the players never actually die, but this include adds a fake OnPlayerDeath. 3. Damage is automatically done in OnPlayerDamage after you process it. For example, this is how you disable helipark and car parking damage: Код:
public OnPlayerDamage(&playerid, &Float:amount, &issuerid, &weapon, &bodypart) { if (weapon == WEAPON_CARPARK || weapon == WEAPON_HELIBLADES) // Disable helikill and carpark return 0; return 1; } Код:
public OnPlayerDamage(&playerid, &Float:amount, &issuerid, &weapon, &bodypart) { if (IsBulletWeapon(weapon) && bodypart == 9) // Increase headshot damage amount *= 1.25; return 1; } Код:
public OnPlayerDamageDone(playerid, Float:amount, issuerid, weapon, bodypart) { return 1; } Код:
public OnPlayerPrepareDeath(playerid, animlib[32], animname[32], &anim_lock, &respawn_time) { return 1; } Код:
public OnPlayerDeathFinished(playerid, bool:cancelable) { return 1; } Код:
public OnPlayerDeathFinished(playerid, bool:cancelable) { if(cancelable) return 0; return 1; } |
I'll go and change the code.