Skocz do zawartości

  • Zaloguj korzystając z Facebooka Zaloguj korzystając z Twittera Zaloguj przez Steam Zaloguj poprzez Google      Logowanie »   
  • Rejestracja

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.

  • Rozpoczynaj nowe tematy i odpowiedaj na inne
  • Zapisz się do tematów i for, aby otrzymywać automatyczne uaktualnienia
  • Dodawaj wydarzenia do kalendarza społecznościowego
  • Stwórz swój własny profil i zdobywaj nowych znajomych
  • Zdobywaj nowe doświadczenia

Dołączona grafika Dołączona grafika

Guest Message by DevFuse
 

Zdjęcie

Modyfikacja-Klasa Miotacz Ogniadiablo


  • Nie możesz napisać tematu
  • Zaloguj się, aby dodać odpowiedź
Brak odpowiedzi do tego tematu

#1 skorpius

    Wszechpomocny

  • Użytkownik

Reputacja: 18
Początkujący

  • Postów:316
  • Imię:Damian
  • Lokalizacja:Dębica
Offline

Napisano 16.01.2015 21:52

Na necie znalazłem klase Terminator która ma Miotacz Ognia

Posiadam Diablo Moda Core i gdy dodaje ta klase to crash

Mógłby przerobic ktos ta klase pod tego diablo?

#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <cstrike>
#include <engine>
#include <fun>
#include <csx>
#include <hamsandwich>

#include <diablo_nowe.inc>

new bool:bKlasa[33];

new wpn_ft
new sprite_fire
new sprite_burn
new sprite_xplo
new g_freezetime
new g_restarted
new Float:g_starttime
new cvar_enabled
new cvar_damage
new cvar_xplode_dmg
new cvar_fuelcost
new cvar_fueltank
new cvar_buyzone
new cvar_buytime
new cvar_damage_dis
new cvar_splash_dis
new g_buyzone[33]
new g_FuelTank[33]
new g_Activated[33]
new Float:g_Delay[33]
new g_hasFlamethrower[33]
new g_FireFlamethrower[33]
new g_BuyFuel[33]
new cvar_expdiablo

static PLUGIN_NAME[] 	= "Miotacz Ognia na Diablo"
static PLUGIN_AUTHOR[] 	= "Cheap_Suit eited by Crew(&Kewin.)"
static PLUGIN_VERSION[] = "1.1"

new const szNazwaKlasy[] = "Terminator";
new const iHealth = 150;
new const szOpis[] = "<br><br>Na start:<br>+150HP,<br>+MP5<br><br>Masz miotacz ognia (zaloz MP5, aby uzyc)<br>Po uzyciu umiejstnosci przez 10s zadajesz +8DMG i trwa muzyka.<br><br>Klasa Premium: Flaga_P<br><br>";
new const iFlags = FLAG_ALL;
new const szFraction[] = "Klasy Unikatowe";

public plugin_init()
{
	RegisterHam(Ham_Spawn, "player", "Spawn", 1);	
	
	diablo_register_class( szNazwaKlasy, iHealth, szOpis, iFlags, szFraction );
	
	register_plugin(PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR)
	register_cvar("ft_version", PLUGIN_VERSION, FCVAR_SERVER)
	
	cvar_enabled 	= register_cvar("ft_enable", 		"1")
	cvar_fueltank 	= register_cvar("ft_fueltank", 		"50")
	cvar_damage	= register_cvar("ft_damage", 		"15")
	cvar_fuelcost	= register_cvar("ft_fuelcost", 		"50")
	cvar_xplode_dmg = register_cvar("ft_xplode_dmg", 	"30")
	cvar_damage_dis	= register_cvar("ft_damage_dis", 	"100")
	cvar_expdiablo 	= register_cvar("diablo_xpmiotacz", 	"17")
	
	register_event("DeathMsg",  	"Event_DeathMsg", 	"a")
	register_event("CurWeapon", 	"Event_CurWeapon", 	"be", 	"1=1")
	register_event("HLTV", 		"Event_NewRound", 	"a", 	"1=0", "2=0")
	register_event("TextMsg", 	"Event_WeaponDrop", 	"be", 	"2=#Weapon_Cannot_Be_Dropped")
	register_event("TextMsg", 	"Event_GameRestart", 	"a", 	"2=#Game_Commencing", 	"2=#Game_will_restart_in")
	register_logevent("LogEvent_RoundStart", 		 2, 	"0=World triggered",	"1=Round_Start")
	
	register_forward(FM_CmdStart,		"fw_CmdStart")
	register_forward(FM_PlayerPostThink, 	"fw_PlayerPostThink")
	register_forward(FM_UpdateClientData, 	"fw_UpdateClientData_Post", 1)
	
	register_think("flamethrower", "think_Flamethrower")
	register_touch("flamethrower", "player", "touch_Flamethrower")
	wpn_ft = custom_weapon_add("weapon_flamethrower", 0, "flamethrower")
	
	if(!get_pcvar_num(cvar_enabled)) pause("ad", PLUGIN_NAME)
}

public plugin_precache()
{
	precache_sound("diablomod/flamethrower.wav")
	precache_sound("items/ammopickup2.wav")
	
	sprite_xplo = precache_model("sprites/zerogxplode.spr")
	sprite_fire = precache_model("sprites/explode1.spr")
	sprite_burn = precache_model("sprites/xfire.spr")
	
	precache_model("models/v_mp5.mdl")
	precache_model("models/p_mp5.mdl")
	precache_model("models/diablomod/w_flamethrower.mdl")
	precache_model("models/diablomod/v_flamethrower.mdl")
	precache_model("models/diablomod/p_flamethrower.mdl")
}


public Event_GameRestart() {
	g_restarted = 1
}

public Event_NewRound() 
{
	if(g_restarted)
	{
		new Players[32], iNum = 0
		get_players(Players, iNum)
		for(new i = 0; i < iNum; i++) 
		{
			new id = Players[i]
			
			g_FuelTank[id] = 0
			g_Activated[id] = 0
			g_hasFlamethrower[id] = 0
			
			new temp[2], weaponID = get_user_weapon(id, temp[0], temp[1])
			if(weaponID == CSW_MP5NAVY) set_mp5navy_model(id)
			
			g_restarted = 0
		}
	}
	
	new flamethrowers = -1
	while((flamethrowers = find_ent_by_class(flamethrowers, "flamethrower")))
		remove_entity(flamethrowers)
	
	g_freezetime = 1
}

public LogEvent_RoundStart()
{
	g_freezetime = 0
	g_starttime = get_gametime()
}

public Event_WeaponDrop(id)
{
	if(!is_user_alive(id) || !g_Activated[id])
		return PLUGIN_CONTINUE
	
	client_print(id, print_center, "")
	return PLUGIN_HANDLED
}

public Event_DeathMsg() 
{ 
	new id = read_data(2)
	if(!is_user_connected(id) || !g_hasFlamethrower[id]) {
		return PLUGIN_CONTINUE
	}
	
	return PLUGIN_CONTINUE
}

public Event_CurWeapon(id)
{
	if(!is_user_alive(id) || !g_hasFlamethrower[id]) 
		return PLUGIN_CONTINUE
	
	new WeaponID = read_data(2)
	switch(WeaponID) 
	{
		case CSW_MP5NAVY:
		{
			set_task(0.3, "task_ActivateFlamethrower", id)
			set_flamethrower_model(id)
			entity_set_int(id, EV_INT_weaponanim, 9)
		}
		default: g_Activated[id] = 0
	}
	return PLUGIN_CONTINUE
}

public touch_Flamethrower(ent, id)
{
	if(!is_valid_ent(ent) || !is_user_alive(id)) 
		return PLUGIN_CONTINUE
	
	if(g_hasFlamethrower[id])
		return PLUGIN_CONTINUE
	
	if(has_shield(id))
		return PLUGIN_CONTINUE
	
	g_hasFlamethrower[id] = 1
	client_cmd(id, "spk items/ammopickup2")
	g_FuelTank[id] = entity_get_int(ent, EV_INT_iuser4)
	show_fuel_percentage(id)
	
	new temp[2], weaponID = get_user_weapon(id, temp[0], temp[1])
	if(weaponID == CSW_MP5NAVY) 
	{
		g_Activated[id] = true
		set_flamethrower_model(id)
		entity_set_int(id, EV_INT_weaponanim, 9)
	}
	remove_entity(ent)
	
	return PLUGIN_CONTINUE
}

public fw_UpdateClientData_Post(id, sendweapons, cd_handle) 
{
	if(!g_hasFlamethrower[id] || !g_Activated[id])
		return FMRES_IGNORED
	
	set_cd(cd_handle, CD_ID, 0)
	return FMRES_HANDLED
}

public fw_CmdStart(id, uc_handle, seed) 
{
	if(!g_hasFlamethrower[id] || !g_Activated[id])
		return FMRES_IGNORED
	
	new buttons = get_uc(uc_handle, UC_Buttons)
	if(buttons & IN_ATTACK)
	{
		g_FireFlamethrower[id] = 1
	
		buttons &= ~IN_ATTACK
		set_uc(uc_handle, UC_Buttons, buttons)
	} else 
		g_FireFlamethrower[id] = 0
		
	if(buttons & IN_ATTACK2) 
	{
		g_BuyFuel[id] = 1
		
		buttons &= ~IN_ATTACK2
		set_uc(uc_handle, UC_Buttons, buttons)
	} else 
		g_BuyFuel[id] = 0
	return FMRES_HANDLED
}

public fw_PlayerPostThink(id)
{
	if(!is_user_connected(id) || !is_user_alive(id))
		return FMRES_IGNORED
	
	if(!g_hasFlamethrower[id] || !g_Activated[id])
		return FMRES_IGNORED
	
	if(entity_get_int(id, EV_INT_waterlevel) > 1)
		return FMRES_IGNORED
	
	if(has_shield(id))
	{
		return FMRES_IGNORED
	}
	
	if(g_BuyFuel[id])
	{
		if((g_Delay[id] + 0.2) < get_gametime())
		{
			buy_fuel(id)
			g_Delay[id] = get_gametime()
		}
	}
	
	if(g_FireFlamethrower[id])
	{
		if(g_FuelTank[id] > 0)
		{
			if((g_Delay[id] + 0.2) < get_gametime())
			{
				g_FuelTank[id] -= 1
				g_Delay[id] = get_gametime()
			}
			
			new Float:fOrigin[3], Float:fVelocity[3]
			entity_get_vector(id,EV_VEC_origin, fOrigin)
			VelocityByAim(id, 35, fVelocity)
			
			new Float:fTemp[3], iFireOrigin[3]
			
			FVecIVec(fTemp, iFireOrigin)
			
			new Float:fFireVelocity[3], iFireVelocity[3]
			VelocityByAim(id, get_pcvar_num(cvar_damage_dis), fFireVelocity)
			FVecIVec(fFireVelocity, iFireVelocity)
			
			create_flames_n_sounds(id, iFireOrigin, iFireVelocity)
			
			new doDamage
			switch(get_cvar_num("mp_friendlyfire"))
			{
				case 0: doDamage = 0
					case 1: doDamage = 1
				}
			
			show_fuel_percentage(id)
			direct_damage(id, doDamage)
			indirect_damage(id, doDamage)
			custom_weapon_shot(wpn_ft, id)
		} else
		client_print(id, print_center, "Brak Benzyny")
	}
	return FMRES_IGNORED
}

public think_Flamethrower(ent)
{
	if(is_valid_ent(ent) && entity_get_float(ent, EV_FL_health) < 950.0) 
	{
		new Float:fOrigin[3], iOrigin[3]
		entity_get_vector(ent, EV_VEC_origin, fOrigin)
		FVecIVec(fOrigin, iOrigin)
		
		message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
		write_byte(99)
		write_short(ent)
		message_end()
		
		message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
		write_byte(3)
		write_coord(iOrigin[0])
		write_coord(iOrigin[1])
		write_coord(iOrigin[2])
		write_short(sprite_xplo)
		write_byte(50)
		write_byte(15)
		write_byte(0)
		message_end()
		
		RadiusDamage(fOrigin, get_pcvar_num(cvar_xplode_dmg), entity_get_int(ent, EV_INT_iuser4))
		remove_entity(ent)
	}
	if(is_valid_ent(ent)) entity_set_float(ent, EV_FL_nextthink, halflife_time() + 0.01)
}

public create_flames_n_sounds(id, origin[3], velocity[3])
{
	message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
	write_byte(120)
	write_coord(origin[0])
	write_coord(origin[1])
	write_coord(origin[2])
	write_coord(velocity[0])
	write_coord(velocity[1])
	write_coord(velocity[2] + 5)
	write_short(sprite_fire)
	write_byte(1)
	write_byte(10)
	write_byte(1)
	write_byte(5)
	message_end()
	
	emit_sound(id, CHAN_WEAPON, "diablomod/flamethrower.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
}

public direct_damage(id, doDamage)
{
	new ent, body
	get_user_aiming(id, ent, body, get_pcvar_num(cvar_damage_dis) + 500)
	
	if(ent > 0 && is_user_alive(ent))
	{
		if(!doDamage)
		{
			if(get_user_team(id) != get_user_team(ent)) 
			{
				damage_user(id, ent, get_pcvar_num(cvar_damage))
				custom_weapon_dmg(wpn_ft, id, ent, get_pcvar_num(cvar_damage))
			}
		}
		else
		{
			damage_user(id, ent, get_pcvar_num(cvar_damage))	
			custom_weapon_dmg(wpn_ft, id, ent, get_pcvar_num(cvar_damage))
		}
	}
}

public indirect_damage(id, doDamage)
{
	new Players[32], iNum
	get_players(Players, iNum, "a")
	for(new i = 0; i < iNum; ++i) if(id != Players[i])
{
	new target = Players[i]
	
	new Float:fOrigin[3], Float:fOrigin2[3]
	entity_get_vector(id,EV_VEC_origin, fOrigin)
	entity_get_vector(target, EV_VEC_origin, fOrigin2)
	
	new temp[3], Float:fAim[3]
	get_user_origin(id, temp, 3)
	IVecFVec(temp, fAim)
	
	new Float:fDistance = get_pcvar_num(cvar_damage_dis) + 500.0
	if(get_distance_f(fOrigin, fOrigin2) > fDistance)
		continue 
		
		
		
		
		if(!doDamage)
		{
			if(get_user_team(id) != get_user_team(target))
			{
				damage_user(id, target, get_pcvar_num(cvar_damage))
				custom_weapon_dmg(wpn_ft, id, target, get_pcvar_num(cvar_damage))
			}
		}
		else 
		{
			damage_user(id, target, get_pcvar_num(cvar_damage) / 2)
			custom_weapon_dmg(wpn_ft, id, target, get_pcvar_num(cvar_damage) / 2)
		}
	}
}

public buy_fuel(id)
{
	if(get_pcvar_num(cvar_buyzone) && !g_buyzone[id])
		return PLUGIN_CONTINUE
	
	new Float:fBuyTime = get_cvar_float("mp_buytime") * 30
	if(get_pcvar_num(cvar_buytime) && !g_freezetime 
	&& (get_gametime() - g_starttime) > fBuyTime)
	return PLUGIN_CONTINUE
	
	if(g_FuelTank[id] >= get_pcvar_num(cvar_fueltank))
		return PLUGIN_CONTINUE
	
	new iMoney = cs_get_user_money(id)
	new iCost = get_pcvar_num(cvar_fuelcost)
	if(iMoney >= iCost)
	{
		g_FuelTank[id] += 1
		show_fuel_percentage(id)
		cs_set_user_money(id, iMoney - iCost)
		
		return PLUGIN_CONTINUE
	}	
	return PLUGIN_CONTINUE
}

public task_ActivateFlamethrower(id) 
{
	if(!is_user_connected(id) || !is_user_alive(id))
		return PLUGIN_CONTINUE
	
	new temp[2], weaponID = get_user_weapon(id, temp[0], temp[1])
	if(weaponID == CSW_MP5NAVY) g_Activated[id] = 1
	
	return PLUGIN_CONTINUE
}

public show_fuel_percentage(id)
{
	set_hudmessage(255, 170, 0, 0.91, 0.95, _, _, 1.0, _, _, 4)
	show_hudmessage(id, "Benzyna: %d%%", get_percent(g_FuelTank[id], get_pcvar_num(cvar_fueltank)))
}

public set_flamethrower_model(id)
{
	entity_set_string(id, EV_SZ_viewmodel, "models/diablomod/v_flamethrower.mdl")
	entity_set_string(id, EV_SZ_weaponmodel, "models/diablomod/p_flamethrower.mdl")
}

public set_mp5navy_model(id)
{
	entity_set_string(id, EV_SZ_viewmodel, "models/v_mp5.mdl")
	entity_set_string(id, EV_SZ_weaponmodel, "models/p_mp5.mdl")	
}

stock damage_user(id, iVictim, fDamage)
{
	new iHealth = get_user_health(iVictim)
	if(iHealth > fDamage) 
		fakedamage(iVictim, "weapon_flamethrower", Float:fDamage, DMG_BURN)
	else
	{
		new iXp = get_pcvar_num(cvar_expdiablo);
		set_hudmessage(255, 212, 0, -1.0, 0.30, 0, 2.0, 2.0, 0.05, 0.05, 4)
		show_hudmessage(0, "+ %d", iXp);
		diablo_add_xp(id,diablo_get_user_exp(id) + iXp)
		
		user_silentkill(iVictim)
		make_deathmsg(id, iVictim, 0, "flamethrower")
		
		new iOrigin[3]
		get_user_origin(iVictim, iOrigin, 0)
		
		message_begin(MSG_BROADCAST,SVC_TEMPENTITY)
		write_byte(17)
		write_coord(iOrigin[0])
		write_coord(iOrigin[1])
		write_coord(iOrigin[2] + 10)
		write_short(sprite_burn)
		write_byte(30)
		write_byte(40)
		message_end()
		
		if(get_user_team(id) != get_user_team(iVictim))
		{
			set_user_frags(id, get_user_frags(id) + 1)
			cs_set_user_money(id, cs_get_user_money(id) + 300)
		}
		else
		{
			set_user_frags(id, get_user_frags(id) - 1)
			cs_set_user_money(id, cs_get_user_money(id) - 300)
		}
		
		message_begin(MSG_ALL, get_user_msgid("ScoreInfo")) 
		write_byte(id) 
		write_short(get_user_frags(id)) 
		write_short(get_user_deaths(id)) 
		write_short(0) 
		write_short(get_user_team(id)) 
		message_end() 
		
		message_begin(MSG_ALL, get_user_msgid("ScoreInfo")) 
		write_byte(iVictim) 
		write_short(get_user_frags(iVictim))
		write_short(get_user_deaths(iVictim))
		write_short(0)
		write_short(get_user_team(iVictim))
		message_end()
	}
}

stock get_percent(value, tvalue) {       
	return floatround(floatmul(float(value) / float(tvalue) , 100.0))  
}

stock get_distance_to_line(Float:pos_start[3], Float:pos_end[3], Float:pos_object[3])  
{  
	new Float:vec_start_end[3], Float:vec_start_object[3], Float:vec_end_object[3], Float:vec_end_start[3]
	xs_vec_sub(pos_end, pos_start, vec_start_end) 		// vector from start to end 
	xs_vec_sub(pos_object, pos_start, vec_start_object) 	// vector from end to object 
	xs_vec_sub(pos_start, pos_end, vec_end_start) 		// vector from end to start 
	xs_vec_sub(pos_end, pos_object, vec_end_object) 		// vector object to end 
	
	new Float:len_start_object = getVecLen(vec_start_object) 
	new Float:angle_start = floatacos(xs_vec_dot(vec_start_end, vec_start_object) / (getVecLen(vec_start_end) * len_start_object), degrees)  
	new Float:angle_end = floatacos(xs_vec_dot(vec_end_start, vec_end_object) / (getVecLen(vec_end_start) * getVecLen(vec_end_object)), degrees)  
	
	if(angle_start <= 90.0 && angle_end <= 90.0) 
		return floatround(len_start_object * floatsin(angle_start, degrees)) 
	return -1  
}

stock Float:getVecLen(Float:Vec[3])
{ 
	new Float:VecNull[3] = {0.0, 0.0, 0.0}
	new Float:len = get_distance_f(Vec, VecNull)
	return len
}

stock bool:fm_is_ent_visible(index, entity) 
{
	new Float:origin[3], Float:view_ofs[3], Float:eyespos[3]
	pev(index, pev_origin, origin)
	pev(index, pev_view_ofs, view_ofs)
	xs_vec_add(origin, view_ofs, eyespos)
	
	new Float:entpos[3]
	pev(entity, pev_origin, entpos)
	engfunc(EngFunc_TraceLine, eyespos, entpos, 0, index)
	
	switch(pev(entity, pev_solid)) {
		case SOLID_BBOX..SOLID_BSP: return global_get(glb_trace_ent) == entity
		}
	
	new Float:fraction
	global_get(glb_trace_fraction, fraction)
	if(fraction == 1.0)
		return true
	
	return false
}

stock bool:has_shield(id)
{
	new modelName[32]
	entity_get_string(id, EV_SZ_viewmodel, modelName, 31)
	
	if(containi(modelName, "v_shield_") != -1)
		return true
	
	return false
}

public diablo_class_enabled(id){       
	bKlasa[id] = true;
	
	g_hasFlamethrower[id] = 1
	g_FuelTank[id] = get_pcvar_num(cvar_fueltank)
	
	new temp[2], weaponID = get_user_weapon(id, temp[0], temp[1])
	if(weaponID == CSW_MP5NAVY) 
	{
		g_Activated[id] = true
		set_flamethrower_model(id)
	}
	
	client_cmd(id, "spk items/ammopickup2")
	client_print(id, print_chat, "Masz miotacz ognia (zaloz MP5, aby uzyc)")
}

public diablo_class_disabled(id){
	bKlasa[id] = false;
	g_hasFlamethrower[id] = 0
}

public diablo_class_spawned(id)
{
	give_item(id, "weapon_mp5navy")
	give_item(id,"ammo_9mm") 
	give_item(id,"ammo_9mm") 
	give_item(id,"ammo_9mm")

	if(is_user_connected(id) && bKlasa[id])
	{
		g_hasFlamethrower[id] = 1
		g_FuelTank[id] = get_pcvar_num(cvar_fueltank)
		
		new temp[2], weaponID = get_user_weapon(id, temp[0], temp[1])
		if(weaponID == CSW_MP5NAVY) 
		{
			g_Activated[id] = true
			set_flamethrower_model(id)
		}
		
		client_cmd(id, "spk items/ammopickup2")
		client_print(id, print_chat, "Masz miotacz ognia (zaloz MP5, aby uzyc)")
	}
	
	return PLUGIN_CONTINUE;
	
}

  • +
  • -
  • 0

4680134.png





Użytkownicy przeglądający ten temat: 0

0 użytkowników, 0 gości, 0 anonimowych