11.07.2015, 16:39
(
Последний раз редактировалось Jeroen52; 11.07.2015 в 17:22.
)
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; } |
What is SetDisableSyncBugs doing?
And it seems when respawning according to the include, it somehow can't check if the player is actually using that skin in OnPlayerSpawn, like this.
Код:
if(GetPlayerSkin(playerid) == 151) { SendInfoMessage(playerid, -1, "You are using skin ID 151"); }
Edit: We are also using SpawnPlayer(player); at a couple commands to respawn players, they don't detect skins used either.
Edit2: I have attempted to put the code in public OnPlayerDeathFinished(playerid, bool:cancelable) and it didn't work either.
Edit3: I am looking to figure out how SetCustomFallDamage works, every time I set something the little falls don't do any damage.