Mam taki kod, który działał i nagle nie wiem co się stało ale głowa mi pęka od kombinowania..
#include <amxmodx> #include <amxmisc> #include <fakemeta> #include <cstrike> #include <engine> #include <fakemeta_util> #include <hamsandwich> #include <fun> new g_MaxDmg; new pCvarHE; new fdamage; public plugin_init() { register_plugin("start", "0.0", "xxx") register_event("TextMsg","start","a","2&#Game_C") RegisterHam(Ham_TakeDamage, "player", "Player_TakeDamage", 0); g_MaxDmg = register_cvar("amx_he_maxdmg", "60"); pCvarHE = register_cvar("kaboom_he","1") fdamage = register_cvar("mp_friendly_grenade_damage", "2") ///////////////////////////////////////////////////////////////////// } public Player_TakeDamage(this, idinflictor, idattacker, Float:damage, damagebits) { static Float:he_damage; he_damage = get_pcvar_float(g_MaxDmg); if(damagebits & (1<<24) && damage > he_damage) { SetHamParamFloat(4, he_damage); return HAM_HANDLED; } new damage = get_pcvar_num(fdamage) if (damage && ( damagebits & DMG_GRENADE )) { if(is_user_alive(this) && this==idattacker) SetHamParamFloat(4, 0.0) return HAM_IGNORED; if (damage == 2) { if(is_user_alive(this) && get_user_team(this)==get_user_team(idattacker)) { SetHamParamFloat(4, 0.0) } } return HAM_IGNORED; } }
granat he powinien zadawać max 60dmg drużynie przeciwnej tylko i wyłącznie, a jakkolwiek bym tego kodu nie zmieniał, to he zadaje 60dmg samemu sobie, a przeciwnikom różnie kodu jest więcej, to tylko część która mi nagle przestała działać