Co jest źle ze nie działa 1/1 Z HE
Majster02
19.05.2019
#include <amxmodx> #include <amxmisc> #include <codmod> #include <hamsandwich> #include <fun> #define DMG_HEGRENADE (1<<24) new const nazwa[] = "sds"; new const opis[] = "sds"; new const bronie = (1<<CSW_HEGRENADE)|(1<<CSW_UMP45); new const zdrowie = 0; new const kondycja = 0; new const inteligencja = 0; new const wytrzymalosc = 0; new bool:ma_klase[33]; public plugin_init() { register_plugin(nazwa, "1.0", "amxx.pl"); cod_register_class(nazwa, opis, bronie, zdrowie, kondycja, inteligencja, wytrzymalosc); RegisterHam(Ham_TakeDamage, "player", "TakeDamage"); } public cod_class_enabled(id) { give_item(id, "weapon_hegrenade"); } public TakeDamage(this, idinflictor, idattacker, Float:damage, damagebits) { if(!is_user_connected(idattacker)) return HAM_IGNORED; if(!ma_klase[idattacker]) return HAM_IGNORED; if(get_user_team(this) != get_user_team(idattacker) && damagebits & DMG_HEGRENADE) cod_inflict_damage(idattacker, this, float(get_user_health(this))-damage+1.0, 0.0, idinflictor, damagebits); return HAM_IGNORED; }
Użytkownik Majster02 edytował ten post 19.05.2019 14:11
Rivit
19.05.2019
if(!ma_klase[idattacker])
return HAM_IGNORED;
to zawsze jest false.
nigdzie nie ustawiasz ma_klase na true/false
popatrz w generator klas jak to jest robione
Majster02
20.05.2019
if(!ma_klase[idattacker])
return HAM_IGNORED;
to zawsze jest false.
nigdzie nie ustawiasz ma_klase na true/false
popatrz w generator klas jak to jest robione
Mam pytanko , Dałbyś przykład klasy 1/1 z He ? będę bardzo wdzięczny /Pozdrawiam
AwIlL^^
20.05.2019
#include <amxmodx> #include <amxmisc> #include <codmod> #include <hamsandwich> #include <fun> #define DMG_HEGRENADE (1<<24) new const nazwa[] = "sds"; new const opis[] = "sds"; new const bronie = (1<<CSW_HEGRENADE)|(1<<CSW_UMP45); new const zdrowie = 0; new const kondycja = 0; new const inteligencja = 0; new const wytrzymalosc = 0; new bool:ma_klase[33]; public plugin_init() { register_plugin(nazwa, "1.0", "amxx.pl"); cod_register_class(nazwa, opis, bronie, zdrowie, kondycja, inteligencja, wytrzymalosc); RegisterHam(Ham_TakeDamage, "player", "TakeDamage"); } public cod_class_enabled(id) { give_item(id, "weapon_hegrenade"); ma_klase[id] = true; } public cod_class_disabled(id) { ma_klase[id] = false; } public TakeDamage(this, idinflictor, idattacker, Float:damage, damagebits) { if(!is_user_connected(idattacker)) return HAM_IGNORED; if(!ma_klase[idattacker]) return HAM_IGNORED; if(get_user_team(this) != get_user_team(idattacker) && damagebits & DMG_HEGRENADE) cod_inflict_damage(idattacker, this, float(get_user_health(this))-damage+1.0, 0.0, idinflictor, damagebits); return HAM_IGNORED; }
Majster02
20.05.2019
#include <amxmodx> #include <amxmisc> #include <codmod> #include <hamsandwich> #include <fun> #define DMG_HEGRENADE (1<<24) new const nazwa[] = "sds"; new const opis[] = "sds"; new const bronie = (1<<CSW_HEGRENADE)|(1<<CSW_UMP45); new const zdrowie = 0; new const kondycja = 0; new const inteligencja = 0; new const wytrzymalosc = 0; new bool:ma_klase[33]; public plugin_init() { register_plugin(nazwa, "1.0", "amxx.pl"); cod_register_class(nazwa, opis, bronie, zdrowie, kondycja, inteligencja, wytrzymalosc); RegisterHam(Ham_TakeDamage, "player", "TakeDamage"); } public cod_class_enabled(id) { give_item(id, "weapon_hegrenade"); ma_klase[id] = true; } public cod_class_disabled(id) { ma_klase[id] = false; } public TakeDamage(this, idinflictor, idattacker, Float:damage, damagebits) { if(!is_user_connected(idattacker)) return HAM_IGNORED; if(!ma_klase[idattacker]) return HAM_IGNORED; if(get_user_team(this) != get_user_team(idattacker) && damagebits & DMG_HEGRENADE) cod_inflict_damage(idattacker, this, float(get_user_health(this))-damage+1.0, 0.0, idinflictor, damagebits); return HAM_IGNORED; }
NIe zabija natychmiastowo tylko zabiera 90hp
Rivit
20.05.2019
Bo to jest kupa a nie zadawanie obrażeń.
Może coś takiego jak w załączniku jest? Tam jest 1/3, ale łatwo przerobić usuwając po prostu to loswanie liczby.
Klasa wzięta z mojej dość leciwej paczki:
https://amxx.pl/topi...-paczki-modeli/
Załączone pliki
Majster02
20.05.2019
: warning 217: loose indentation /p\compiler\codclass_Predator.sma(41) : error 017: undefined symbol "cod_remove_user_rendering" /\compiler\codclass_Predator.sma(54) : error 017: undefined symbol "cod_set_user_rendering" \compiler\codclass_Predator.sma(66) : error 017: undefined symbol "cod_remove_user_rendering" \compiler\codclass_Predator.sma(74) : warning 217: loose indentation /\compiler\codclass_Predator.sma(118) : warning 217: loose indentation \compiler\codclass_Predator.sma(119) : warning 217: loose indentation
Bo to jest kupa a nie zadawanie obrażeń.
Może coś takiego jak w załączniku jest? Tam jest 1/3, ale łatwo przerobić usuwając po prostu to loswanie liczby.
Klasa wzięta z mojej dość leciwej paczki:
NBłedy
Rivit
20.05.2019
Podałem przykład, który jest do specyficznej paczki, więc nie będzie się kompilować na defaultowym kompilatorze
Prosta podmiana w kodzie AwiiL'a - zamieniasz funkcje TakeDamage oraz wklejasz funkcję KillPlayer i ma śmigać