Page 1 of 1

No fall damage

Posted: 2012 Apr 22 20:52
by Pukuotukas951
Radau pluginą zm, noriu persidaryti ant paprastų serverių pvz: public, bet čia pieva gaunasi, kažkaip sudėjau koda bet neveikia, padėkit:

Code: Select all

#include <amxmodx>#include <amxmisc>#include <hamsandwich> #define PLUGIN "No fall damage for zombies"#define VERSION "1.0"#define AUTHOR "Sn!ff3r" #define DMG_FALL (1<<5) public plugin_init() {    register_plugin(PLUGIN, VERSION, AUTHOR)    RegisterHam(Ham_TakeDamage, "player", "fw_TakeDamage")} public fw_TakeDamage(victim, inflictor, attacker, Float:damage, damage_type){    if (!(damage_type & DMG_FALL))        return HAM_IGNORED        if (!get_user_team(id) == 2 && get_user_team(id) == 1(victim))        return HAM_IGNORED        return HAM_SUPERCEDE} 

Re: No fall damage

Posted: 2012 Apr 22 21:07
by newb

Code: Select all

public fw_TakeDamage(victim, inflictor, attacker, Float:damage, damage_type) {    return damage_type == DMG_FALL ? HAM_SUPERCEDE : HAM_IGNORED}

Re: No fall damage

Posted: 2012 Apr 22 21:46
by aaarnas
newb wrote:

Code: Select all

public fw_TakeDamage(victim, inflictor, attacker, Float:damage, damage_type) {    return damage_type == DMG_FALL ? HAM_SUPERCEDE : HAM_IGNORED}

Code: Select all

public fw_TakeDamage(victim, inflictor, attacker, Float:damage, damage_type) {    return damage_type & DMG_FALL ? HAM_SUPERCEDE : HAM_IGNORED}

Re: No fall damage

Posted: 2012 Apr 23 06:52
by xFrostas
yra config'e cvaras fall_damage ar kaip, jį galima išjungti ir įjungti

Re: No fall damage

Posted: 2012 Apr 23 08:45
by newb
Maciau hlevas rase su == ^_^

Re: No fall damage

Posted: 2012 Apr 23 09:14
by aaarnas
Jis irgi daro klaidų. Taip išeina, kad jis žmogus :/

DMG_FALL yra bit sumai. Aš nežinau, kaip cs interpretuoja žalą. Taip suprantu, kad gali būti kelios žalos vienu metu, bet tai būtų keista.
Jei tuo momentu, žaidėjas patirs tik DMG_FALL, tai viskas bus gerai, bet jei cs pateikia daugiau nei vieną žalą vienu metu, tai bus ne visada gerai.