Witam Serdecznie.
Mam małe pytanie, jak dodać do klasy obrażenia z broni np. M4 + xxx % obrażeń z int ?
Witamy w Nieoficjalnym polskim support'cie AMX Mod X
Witamy w Nieoficjalnym polskim support'cie AMX Mod X, jak w większości społeczności internetowych musisz się zarejestrować aby móc odpowiadać lub zakładać nowe tematy, ale nie bój się to jest prosty proces w którym wymagamy minimalnych informacji.
|
Guest Message by DevFuse

7 odpowiedzi w tym temacie
#1
Napisano 12.01.2013 20:22
#2
Napisano 12.01.2013 20:36
Do includów dodajesz:
#include <hamsandwich> #include <codmod>Do plugin_init dodajesz
RegisterHam(Ham_TakeDamage, "player", "TakeDamage");Na końcu pluginu dodajesz:
public TakeDamage(this, idinflictor, idattacker, Float:damage, damagebits){ if(!is_user_connected(idattacker)) return HAM_IGNORED; if(!ma_perk[idattacker]) return HAM_IGNORED; if(!is_user_connected(this)) return HAM_IGNORED; if(get_user_team(this)==get_user_team(idattacker)) return HAM_IGNORED; if(damage<=0) return HAM_IGNORED; if(get_user_weapon(idattacker)==CSW_M4A1 && is_user_connected(idattacker)) cod_inflict_damage(idattacker, this, 150.0, 0.5, idinflictor, damagebits); //150 to ile dodatkowego DMG zadaje. 0.5 to ile int to 1DMG (tutaj gdy masz 2 int zadajesz 1 dmg wiecej) return HAM_IGNORED; }
#3
Napisano 12.01.2013 20:39
Coś takiego?
#include <amxmodx> #include <amxmisc> #include <codmod_frakcje> #include <engine> #include <fun> #include <cstrike> #include <hamsandwich> #include <codmod> new const nazwa[] = "Kunka(Super Premium)"; new const opis[] = "Posiada M4 + 12% int z niego, widzialnosc spada do 60"; new const bronie = (1<<CSW_HEGRENADE)|(1<<CSW_SMOKEGRENADE)|(1<<CSW_M4A1)|(1<<CSW_FLASHBANG)|(1<<CSW_DEAGLE); new const zdrowie = 200; new const kondycja = 250; new const inteligencja = 300; new const wytrzymalosc = 300; new const frakcja[] = "Super Premium"; new ma_klase[33]; public plugin_init() { register_plugin(nazwa, "1.0", "amxx.pl"); cod_register_class(nazwa, opis, bronie, zdrowie, kondycja, inteligencja, wytrzymalosc, frakcja); RegisterHam(Ham_TakeDamage, "player", "TakeDamage"); } public cod_class_enabled(id) { if(!(get_user_flags(id) & ADMIN_LEVEL_H)) { client_print(id, print_chat, "[Kunka(Super Premium)] Nie masz uprawnien, aby uzywac tej klasy.") return COD_STOP; } set_rendering(id,kRenderFxNone, 0, 0, 0, kRenderTransAlpha, 60); give_item(id, "weapon_hegrenade"); give_item(id, "weapon_flashbang"); give_item(id, "weapon_flashbang"); give_item(id, "weapon_smokegrenade"); cs_set_user_nvg(id, 1); cs_set_user_defuse(id, 1); ma_klase[id] = true; return COD_CONTINUE; } public cod_class_disabled(id) { set_rendering(id,kRenderFxNone, 0, 0, 0, kRenderTransAlpha, 255); ma_klase[id] = false; } public TakeDamage(this, idinflictor, idattacker, Float:damage, damagebits){ if(!is_user_connected(idattacker)) return HAM_IGNORED; if(!ma_perk[idattacker]) return HAM_IGNORED; if(!is_user_connected(this)) return HAM_IGNORED; if(get_user_team(this)==get_user_team(idattacker)) return HAM_IGNORED; if(damage<=0) return HAM_IGNORED; if(get_user_weapon(idattacker)==CSW_M4A1 && is_user_connected(idattacker)) cod_inflict_damage(idattacker, this, 150.0, 0.5, idinflictor, damagebits); //150 to ile dodatkowego DMG zadaje. 0.5 to ile int to 1DMG (tutaj gdy masz 2 int zadajesz 1 dmg wiecej) return HAM_IGNORED; }
#4
Napisano 12.01.2013 20:48
Oj przepraszam. Podmień całe TakeDamage
public TakeDamage(this, idinflictor, idattacker, Float:damage, damagebits){ if(!is_user_connected(idattacker)) return HAM_IGNORED; if(!ma_klase[idattacker]) return HAM_IGNORED; if(!is_user_connected(this)) return HAM_IGNORED; if(get_user_team(this)==get_user_team(idattacker)) return HAM_IGNORED; if(damage<=0) return HAM_IGNORED; if(get_user_weapon(idattacker)==CSW_M4A1 && is_user_connected(idattacker)) cod_inflict_damage(idattacker, this, 150.0, 0.5, idinflictor, damagebits); //150 to ile dodatkowego DMG zadaje. 0.5 to ile int to 1DMG (tutaj gdy masz 2 int zadajesz 1 dmg wiecej) return HAM_IGNORED; }No i powinno być dobrze. Tam gdzie:
cod_inflict_damageUstaw DMG tak jak chcesz
#5
Napisano 12.01.2013 20:50
#include <amxmodx> #include <amxmisc> #include <codmod_frakcje> #include <engine> #include <fun> #include <cstrike> #include <hamsandwich> #include <codmod> new const nazwa[] = "Kunka(Super Premium)"; new const opis[] = "Posiada M4 + 12% int z niego, widzialnosc spada do 60"; new const bronie = (1<<CSW_HEGRENADE)|(1<<CSW_SMOKEGRENADE)|(1<<CSW_M4A1)|(1<<CSW_FLASHBANG)|(1<<CSW_DEAGLE); new const zdrowie = 200; new const kondycja = 250; new const inteligencja = 300; new const wytrzymalosc = 300; new const frakcja[] = "Super Premium"; new ma_klase[33]; public plugin_init() { register_plugin(nazwa, "1.0", "amxx.pl"); cod_register_class(nazwa, opis, bronie, zdrowie, kondycja, inteligencja, wytrzymalosc, frakcja); RegisterHam(Ham_TakeDamage, "player", "TakeDamage"); } public cod_class_enabled(id) { if(!(get_user_flags(id) & ADMIN_LEVEL_H)) { client_print(id, print_chat, "[Kunka(Super Premium)] Nie masz uprawnien, aby uzywac tej klasy.") return COD_STOP; } set_rendering(id,kRenderFxNone, 0, 0, 0, kRenderTransAlpha, 60); give_item(id, "weapon_hegrenade"); give_item(id, "weapon_flashbang"); give_item(id, "weapon_flashbang"); give_item(id, "weapon_smokegrenade"); cs_set_user_nvg(id, 1); cs_set_user_defuse(id, 1); ma_klase[id] = true; return COD_CONTINUE; } public cod_class_disabled(id) { set_rendering(id,kRenderFxNone, 0, 0, 0, kRenderTransAlpha, 255); 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(!is_user_connected(this)) return HAM_IGNORED; if(get_user_team(this)==get_user_team(idattacker)) return HAM_IGNORED; if(damage<=0) return HAM_IGNORED; if(get_user_weapon(idattacker)==CSW_M4A1 && is_user_connected(idattacker)) cod_inflict_damage(idattacker, this, 0.0, 10.5, idinflictor, damagebits); //150 to ile dodatkowego DMG zadaje. 0.5 to ile int to 1DMG (tutaj gdy masz 2 int zadajesz 1 dmg wiecej) return HAM_IGNORED; }Objasnienie dmg? Czyli teraz jak mam 10.5 to jak będzie mieć 2 punkty w int to będzie dodatkowo zabierać 5 tak?
#6
Napisano 12.01.2013 21:23
Jak masz 10.5 to za 2 int zabiera 21DMG. Jak masz ustawione 1.0 to za 2 int zabiera 2DMG. Jak masz 2.5 to 2 int to 5DMG
#7
Napisano 12.01.2013 21:26
aha kumam
Dzięki wielkie


#8
Napisano 12.01.2013 21:27
Wiadomość wygenerowana automatycznie
Ten temat został zamknięty przez moderatora.
Powód: Pomoc udzielona
Jeśli się z tym nie zgadzasz,
raportuj ten post, a moderator lub administrator rozpatrzy go ponownie.
Z pozdrowieniami,
Zespół AMXX.PL
Ten temat został zamknięty przez moderatora.
Powód: Pomoc udzielona
Jeśli się z tym nie zgadzasz,

Z pozdrowieniami,
Zespół AMXX.PL
Również z jednym lub większą ilością słów kluczowych: cod nowy
Paczka perkow.perki Napisany przez NAVIK, 24.03.2025 ![]() |
|
![]() |
|||
CoD Nowy
Plugin na małe mapy.Napisany przez NAVIK, 16.02.2025 ![]() |
|
![]() |
|||
CoD Nowy
Dodatkowe, osobne trzy linie opisu klasNapisany przez Rafii, 27.01.2025 ![]() |
|
![]() |
|||
CoD Nowy
problem z kompilacjaNapisany przez Anonimowy09, 21.01.2025 ![]() |
|
![]() |
|||
CoD Nowy
problem z HUDNapisany przez Anonimowy09, 10.01.2025 ![]() |
|
![]() |
Użytkownicy przeglądający ten temat: 0
0 użytkowników, 0 gości, 0 anonimowych