Witam, zrobiłem bardzo prostą klasę, powiem nawet banalną i nie spodziewałem, że tutaj pojawi się jakiś błąd. Klasa tak jak ma w opisie powinna mieć zmniejszoną grawitacje i nie otrzymywać obrażeń od upadku jednak ani jedna funkcja, ani druga nie działa.
#include <amxmodx> #include <codmod> #include <engine> #include <hamsandwich> #define DMG_HEGRENADE (1<<24) #define FALL_VELOCITY 350.0 new const nazwa[] = "Legendarny Colnel"; new const opis[] = "Masz zmniejszona grawitacje 200/800, dostajesz HE i 1/1 na natychmiastowe zabicie z niego, nie tracisz hp od upadku z wysokosci"; new const bronie = 1<<CSW_TMP | 1<<CSW_USP | 1<<CSW_HEGRENADE; new const zdrowie = 0; new const kondycja = 10; new const inteligencja = 0; new const wytrzymalosc = 0; new bool:ma_klase[33]; new bool:falling[33]; public plugin_init() { cod_register_advance(cod_get_classid("Elitarny Colnel"), 190, nazwa, opis, bronie, zdrowie, kondycja, inteligencja, wytrzymalosc); RegisterHam(Ham_TakeDamage, "player", "TakeDamage"); } public cod_codclass_enabled(id) { entity_set_float(id, EV_FL_gravity, 200.0/800.0); } public cod_class_disabled(id) { entity_set_float(id, EV_FL_gravity, 800.0/800.0); } public ResetHUD(id) { if(ma_klase[id]) entity_set_float(id, EV_FL_gravity, 200.0/800.0); } public TakeDamage(this, idinflictor, idattacker, Float:damage, damagebits) { if(!is_user_connected(idattacker)) return HAM_IGNORED; if(!ma_klase[idattacker]) return HAM_IGNORED; if(damagebits & DMG_HEGRENADE && random_num(1, 1) == 1) { cod_inflict_damage(idattacker, this, float(get_user_health(this))-damage+1.0, 0.0, idinflictor, damagebits); } return HAM_IGNORED; } public client_PreThink(id) { if(ma_klase[id] && is_user_alive(id) && is_user_connected(id)) { if(entity_get_float(id, EV_FL_flFallVelocity) >= FALL_VELOCITY) { falling[id] = true; } else { falling[id] = false; } } } public client_PostThink(id) { if(ma_klase[id] && is_user_alive(id) && is_user_connected(id)) { if(falling[id]) { entity_set_int(id, EV_INT_watertype, -3); } } } /* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE *{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1045\\ f0\\ fs16 \n\\ par } */