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.
|
strzal z AWP = Dead
#2
Napisano 17.08.2010 12:26
jeżeli to do cod moda to ci moge powiedzieć jak
#4
Napisano 17.08.2010 12:38
funkcje TakeDamage na
public TakeDamage(this, idinflictor, idattacker, Float:damage, damagebits) { if(!is_user_alive(this) || !is_user_connected(this) || informacje_przedmiotu_gracza[this][0] == 24 || !is_user_connected(idattacker) || get_user_team(this) == get_user_team(idattacker) || !klasa_gracza[idattacker]) return HAM_IGNORED; new health = get_user_health(this); new weapon = get_user_weapon(idattacker); if(health < 2) return HAM_IGNORED; if(informacje_przedmiotu_gracza[this][0] == 27 && informacje_przedmiotu_gracza[this][1]>0) { informacje_przedmiotu_gracza[this][1]--; return HAM_SUPERCEDE; } if(wytrzymalosc_gracza[this]>0) damage -= redukcja_obrazen_gracza[this]*damage; if(informacje_przedmiotu_gracza[this][0] == 2 || informacje_przedmiotu_gracza[this][0] == 3) damage-=(float(informacje_przedmiotu_gracza[this][1])<damage)? float(informacje_przedmiotu_gracza[this][1]): damage; if(informacje_przedmiotu_gracza[idattacker][0] == 5 && !UTIL_In_FOV(this, idattacker) && UTIL_In_FOV(idattacker, this)) damage*=2.0; if(informacje_przedmiotu_gracza[idattacker][0] == 10) damage+=informacje_przedmiotu_gracza[idattacker][1]; if(informacje_przedmiotu_gracza[this][0] == 12) damage-=(5.0<damage)? 5.0: damage; if(weapon == CSW_AWP && informacje_przedmiotu_gracza[idattacker][0] == 13) damage=float(health); if(informacje_przedmiotu_gracza[idattacker][0] == 21) damage+=10; if(informacje_przedmiotu_gracza[idattacker][0] == 22) damage+=20; if(idinflictor != idattacker && entity_get_int(idinflictor, EV_INT_movetype) != 5) { if((informacje_przedmiotu_gracza[idattacker][0] == 9 && random_num(1, informacje_przedmiotu_gracza[idattacker][1]) == 1) || informacje_przedmiotu_gracza[idattacker][0] == 10) damage = float(health); } if(weapon == CSW_KNIFE) { if(informacje_przedmiotu_gracza[this][0] == 4) damage=damage*1.4+inteligencja_gracza[idattacker]; if(klasa_gracza[idattacker] == Nozownik) damage=damage*1.9+inteligencja_gracza[idattacker]; if(informacje_przedmiotu_gracza[idattacker][0] == 8 || (klasa_gracza[idattacker] == Snajper && random(2) == 2) || klasa_gracza[idattacker] == Komandos && !(get_user_button(idattacker) & IN_ATTACK)) damage = float(health); } if(informacje_przedmiotu_gracza[this][0] == 26 && random_num(1, informacje_przedmiotu_gracza[this][1]) == 1) { SetHamParamEntity(3, this); SetHamParamEntity(1, idattacker); } if(weapon == CSW_AWP) damage=float(health)+1; } SetHamParamFloat(4, damage); return HAM_IGNORED; }
#6
Napisano 17.08.2010 13:36
zgadłem?
---
Podaj wszystkie błędy chociaż z tego co widzę to pewno nie masz klasy nożownik.
#7
Napisano 17.08.2010 13:38
if(klasa_gracza[idattacker] == Snajper && (weapon == CSW_AWP || weapon == CSW_SCOUT)) damage = damage+1.5*inteligencja_gracza[idattacker];
Nie musisz tego sprawdzania klasy jeśli nie chcesz : P i mnożnik możesz zmienić
#9
Napisano 17.08.2010 18:25
I rozwiąż równanko
#10
Napisano 18.08.2010 17:11
Użytkownik Intex edytował ten post 18.08.2010 17:11
#11
Napisano 18.08.2010 17:23
~~Terry Pratchett
IMO to samo tyczy się znaków interpunkcyjnych
if(klasa_gracza[idattacker] == Snajper && (weapon == CSW_AWP || weapon == CSW_SCOUT))
damage = damage+1.5*inteligencja_gracza[idattacker];
na
if(klasa_gracza[idattacker] == Snajper && (weapon == CSW_AWP || weapon == CSW_SCOUT))
damage = damage+100.9*inteligencja_gracza[idattacker];
i na pewno będzie 1 shot 1 kill z awp
Użytkownik Apple() edytował ten post 18.08.2010 17:24
#12
Napisano 18.08.2010 20:25
Przed SetHamParamFloat(4, damage)
if(weapon == CSW_AWP && damagebits & DMG_BULLET) damage = float(health); }
To rozwiązanie najlepsze. Dodać możesz sprawdzenie czy klasa gracza to snajper ale to jak kto woli.
Działa na 100% bez zbędnych +wiecejhp.
Użytkownik camilost edytował ten post 18.08.2010 20:27
#14
Napisano 18.08.2010 20:44
if(klasa_gracza[idattacker] == Snajper && (weapon == CSW_AWP || weapon == CSW_SCOUT))
damage = damage+1.5*inteligencja_gracza[idattacker];
I jak dodać to do np. 2 lub 3 klas?
if(klasa_gracza[idattacker] == Snajper || klasa_gracza[idattacker] == Nazwa_KLASY && (weapon == CSW_AWP || weapon == CSW_SCOUT))
damage = damage+1.5*inteligencja_gracza[idattacker];
Tak?
#15
Napisano 18.08.2010 20:51
@NiRVAnA przed SetHamParamFloat(4, damage):
if((klasa_gracza[idattacker] == Snajper || klasa_gracza[idattacker] == Klasa1 || klasa_gracza[idattacker] == Klasa2) && (weapon == CSW_AWP || weapon == CSW_SCOUT) && (damagebits && DMG_BULLET)) damage = damage+1.5*inteligencja_gracza[idattacker];
Zmień klasa1 i klasa2 na swoje 2dodatkowe klasy.
#17
Napisano 18.08.2010 21:39
#19
Napisano 18.08.2010 21:55
#20
Napisano 18.08.2010 22:01
Warning: Function "TakeDamage" should return a value on line 1419 Welcome to the AMX Mod X 1.8.1-300 Compiler. Copyright (c) 1997-2006 ITB CompuPhase, AMX Mod X Team Warning: Loose indentation on line 905 Warning: Loose indentation on line 914 Warning: Loose indentation on line 925 Warning: Loose indentation on line 962 Warning: Loose indentation on line 968 Warning: Loose indentation on line 977 Warning: Loose indentation on line 992 Warning: Loose indentation on line 993 Warning: Loose indentation on line 1005 Warning: Loose indentation on line 1006 Warning: Loose indentation on line 1010 Warning: Function "TakeDamage" should return a value on line 1419 Error: Symbol already defined: "SetHamParamFloat" on line 1421 Error: Invalid function or declaration on line 1422 2 Errors. Could not locate output file C:\Users\Piotrek\Desktop\QTM_CodMod.amx (compile failed).
Użytkownicy przeglądający ten temat: 0
0 użytkowników, 0 gości, 0 anonimowych