←  Pytania

AMXX.pl: Support AMX Mod X i SourceMod

»

Jak dodać klasie awans.

play12 - zdjęcie play12 25.02.2013

Witam chciałbym aby ktoś mi wytłumaczył jak zrobić awans klas czyli np po osiągnieciu wyznaczonego levela na klasie snajper to dostajesz elitarnego snajpera i nie wiem mam zrobione ale coś nie działa proszę o wytłumaczenie :D

Kod klasy w której nie działa a powinno :

#include <amxmodx>
#include <hamsandwich>
#include <amxmisc>
#include <codmod>
	   
#define DMG_BULLET (1<<1)
new const nazwa[]   = "Hunter ";
new const opis[]    = "Zwiększone Dmg o 200 z M4A1 i Ak47. ";
new const bronie    = (1<<CSW_M4A1)|(1<<CSW_AK47);
new const zdrowie   = 110;
new const kondycja  = 48;
new const inteligencja = 50;
new const wytrzymalosc = 200;
new ma_klase[33];
   
public plugin_init()
{
register_plugin(nazwa, "1.0", "Play");
	    RegisterHam(Ham_TakeDamage, "player", "TakeDamage");
cod_register_advance(cod_get_classid("Strzelec Wyborowy"), 600, nazwa, opis, bronie, zdrowie,kondycja,inteligencja,
wytrzymalosc);
}
public cod_class_enabled(id)
{
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) && get_user_weapon(idattacker) == CSW_AK47 && damagebits & DMG_BULLET)
			    cod_inflict_damage(idattacker, this, 200.0, 0.0, idinflictor, damagebits);
	    if(get_user_team(this) != get_user_team(idattacker) && get_user_weapon(idattacker) == CSW_M4A1 && damagebits & DMG_BULLET)
			    cod_inflict_damage(idattacker, this, 200.0, 0.0, idinflictor, damagebits);
	   
	    return HAM_IGNORED;
}
Odpowiedz