Ужасен бъг със плъгина JETPACK VECO

В този раздел можете да подавате всякакви заявки за намиране, изработка или преработка на плъгини/модове.
Аватар
You Owe Me
Извън линия
Потребител
Потребител
Мнения: 185
Регистриран на: 07 Мар 2018, 19:34
Местоположение: Пред компютъра
Получена благодарност: 2 пъти

Ужасен бъг със плъгина JETPACK VECO

Мнение от You Owe Me » 11 Юли 2018, 14:51

Имам ужасен бъг със тоя плъгин... В началото като го сложа си бачка окей, няколко карти по-късно се бъгва и като изстрелям ракета от базуката гръмва веднага, тоест, не излита, ами като я изстреляш веднага гърми, и така е безполезно, не може да биеш по зомбитата.. Ако може да се оправи :/ ReHLDS.

Код за потвърждение: Избери целия код

/*
---------------------------------------------------------
   #  #  #    #===    ###    ##    #
  #    ##     #===   #      #  #    #
   #   #      #===    ###    ##    #
---------------------------------------------------------
[ZP] Extra Item: Jetpack + Bazooka 1.1

Plugin made by <VeCo>
---------------------------------------------------------
If you modify the code, please DO NOT change the author!
---------------------------------------------------------
Contacts:
e-mail: [email protected]
skype: veco_kn
---------------------------------------------------------
Changes log:
 -> v 1.0 = First release!
 -> v 1.1 = Now, the bazooka can break func_breakable
	    entities.
	    Fixed bug with the knife model.
---------------------------------------------------------
Don't forget to visit http://www.amxmodxbg.org :)
---------------------------------------------------------
*/

#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>
#include <engine>
#include <cstrike>
#include <zombieplague>

new sprite_explosion,sprite_beamcylinder, jp_itemid,
cvar_cost,cvar_damage,cvar_speed,cvar_reload_time,cvar_radius,
cvar_start_energy,cvar_remove_energy,cvar_heal_energy,cvar_heal_time,cvar_zvelocity,cvar_aimvelocity,
cvar_can_drop,cvar_one_round,
maxplayers,hudsync, has_jetpack[33],can_shoot[33],energy[33]
public plugin_precache()
{
	precache_model("models/v_egon.mdl")
	precache_model("models/p_egon.mdl")
	precache_model("models/w_egon.mdl")
	
	precache_model("models/rpgrocket.mdl")
	
	sprite_explosion = precache_model("sprites/zerogxplode.spr")
	sprite_beamcylinder = precache_model("sprites/white.spr")
	
	precache_sound("weapons/rocketfire1.wav")
	precache_sound("common/bodydrop2.wav")
	precache_sound("items/gunpickup2.wav")
	precache_sound("jetpack.wav")
}

public plugin_init() {
	register_plugin("[ZP] Extra Item: Jetpack + Bazooka", "1.1", "<VeCo>")
	
	cvar_cost = register_cvar("vecjp_cost","35")
	cvar_speed = register_cvar("vecjp_rocket_speed","800")
	cvar_damage = register_cvar("vecjp_damage","800")
	cvar_reload_time = register_cvar("vecjp_reload_time","10.0")
	cvar_radius = register_cvar("vecjp_radius","150")
	cvar_start_energy = register_cvar("vecjp_start_energy","200")
	cvar_remove_energy = register_cvar("vecjp_remove_energy","1")
	cvar_heal_energy = register_cvar("vecjp_heal_energy","10")
	cvar_heal_time = register_cvar("vecjp_heal_time","1.0")
	cvar_zvelocity = register_cvar("vecjp_zvelocity","300")
	cvar_aimvelocity = register_cvar("vecjp_aimvelocity","300")
	cvar_can_drop = register_cvar("vecjp_can_drop","1")
	cvar_one_round = register_cvar("vecjp_one_round","0")
	
	jp_itemid = zp_register_extra_item("Jetpack + bazooka",get_pcvar_num(cvar_cost),ZP_TEAM_HUMAN)
	
	register_clcmd("drop","drop_jetpack")
	
	RegisterHam(Ham_Weapon_SecondaryAttack,"weapon_knife","shoot_jetpack")
	RegisterHam(Ham_Player_Jump,"player","fly_jetpack")
	
	register_touch("weapon_jetpack","player","get_jetpack")
	register_touch("","info_jetpack_rocket","touch_jetpack")
	
	register_event("DeathMsg","hook_death","a")
	register_event("CurWeapon","event_curweapon","be","1=1","2=29")
	
	register_logevent("round_end",2,"1=Round_End")
	
	maxplayers = get_maxplayers()
	hudsync = CreateHudSyncObj()
}

public zp_extra_item_selected(id,itemid)
{
	if(itemid != jp_itemid) return
	
	if(has_jetpack[id])
	{
		client_print(id,print_chat,"[VECJP] You have already own a jetpack.")
		return
	}
	
	has_jetpack[id] = true
	can_shoot[id] = true
	energy[id] = get_pcvar_num(cvar_start_energy)
	
	emit_sound(id,CHAN_AUTO,"items/gunpickup2.wav",VOL_NORM,ATTN_NORM,0,PITCH_NORM)
	
	client_cmd(id,"weapon_knife")
	
	entity_set_string(id,EV_SZ_viewmodel,"models/v_egon.mdl")
	entity_set_string(id,EV_SZ_weaponmodel,"models/p_egon.mdl")
	
	set_task(get_pcvar_float(cvar_heal_time),"action_heal_user_jetpack",id)
}

public drop_jetpack(id) if(get_pcvar_num(cvar_can_drop) && get_user_weapon(id) == CSW_KNIFE && has_jetpack[id]) action_drop_user_jetpack(id)

public shoot_jetpack(ent)
{
	new id = entity_get_edict(ent,EV_ENT_owner)
	if(!has_jetpack[id]) return HAM_IGNORED
	
	if(!can_shoot[id])
	{
		client_print(id,print_center,"[VECJP] You can't shoot with the jetpack right now. Please wait...")
		return HAM_IGNORED
	}
	
	action_shoot_user_jetpack(id)
	
	return HAM_IGNORED
}

public fly_jetpack(id)
{
	if(!has_jetpack[id]) return HAM_IGNORED
	
	if(!energy[id])
	{
		client_print(id,print_center,"[VECJP] You don't have enough energy to fly.")
		return HAM_IGNORED
	}
	
	if(get_user_button(id) & IN_DUCK) action_fly_user_jetpack(id)
	
	return HAM_IGNORED
}

public action_heal_user_jetpack(id)
{
	if(!is_user_connected(id) || !has_jetpack[id]) return
	
	if(zp_get_user_zombie(id) || zp_get_user_nemesis(id))
	{
		action_remove_user_jetpack(id)
		return
	}
	
	if(entity_get_int(id,EV_INT_flags) & FL_INWATER)
	{
		message_begin(MSG_BROADCAST,SVC_TEMPENTITY)
		write_byte(TE_KILLBEAM)
		write_short(id)
		message_end()
	}
	
	if(entity_get_int(id,EV_INT_flags) & FL_ONGROUND)
	{
		message_begin(MSG_BROADCAST,SVC_TEMPENTITY)
		write_byte(TE_KILLBEAM)
		write_short(id)
		message_end()
		
		if(energy[id] < get_pcvar_num(cvar_start_energy))
		{
			energy[id] += get_pcvar_num(cvar_heal_energy)
			if(energy[id] > get_pcvar_num(cvar_start_energy)) energy[id] = get_pcvar_num(cvar_start_energy)
			
			set_hudmessage(255, 0, 0, -1.0, 0.29, 0, 6.0, 1.0, 0.1, 0.2, -1)
			ShowSyncHudMsg(id,hudsync,"Jetpack Energy: [%i / %i]",energy[id],get_pcvar_num(cvar_start_energy))
		}
	}
	
	set_task(get_pcvar_float(cvar_heal_time),"action_heal_user_jetpack",id)
}

public action_drop_user_jetpack(id)
{
	remove_task(id)
	
	has_jetpack[id] = false
	can_shoot[id] = false
	
	message_begin(MSG_BROADCAST,SVC_TEMPENTITY)
	write_byte(TE_KILLBEAM)
	write_short(id)
	message_end()
	
	emit_sound(id,CHAN_AUTO,"common/bodydrop2.wav",VOL_NORM,ATTN_NORM,0,PITCH_NORM)
	
	new ent = create_entity("info_target")
	if(ent)
	{
		new Float:origin[3],Float:velocity[3]
		
		entity_get_vector(id,EV_VEC_origin,origin)
		velocity_by_aim(id,60,velocity)
		
		origin[0] += velocity[0]
		origin[1] += velocity[1]
		
		entity_set_string(ent,EV_SZ_classname,"weapon_jetpack")
		entity_set_model(ent,"models/w_egon.mdl")
		
		entity_set_int(ent,EV_INT_solid,SOLID_TRIGGER)
		entity_set_int(ent,EV_INT_movetype,MOVETYPE_TOSS)
		
		entity_set_int(ent,EV_INT_iuser1,energy[id])
		
		entity_set_float(ent,EV_FL_gravity,1.0)
		
		entity_set_origin(ent,origin)
	}
	
	energy[id] = 0
}

public action_shoot_user_jetpack(id)
{
	can_shoot[id] = false
	
	emit_sound(id,CHAN_AUTO,"weapons/rocketfire1.wav",VOL_NORM,ATTN_NORM,0,PITCH_NORM)
	
	new ent = create_entity("info_target")
	if(ent)
	{
		new Float:origin[3],Float:velocity[3],Float:angles[3]
		
		entity_get_vector(id,EV_VEC_origin,origin)
		velocity_by_aim(id,60,velocity)
		
		origin[0] += velocity[0]
		origin[1] += velocity[1]
		
		velocity[0] = 0.0
		velocity[1] = 0.0
		
		velocity_by_aim(id,get_pcvar_num(cvar_speed),velocity)
		
		entity_set_string(ent,EV_SZ_classname,"info_jetpack_rocket")
		entity_set_model(ent,"models/rpgrocket.mdl")
		
		entity_set_int(ent,EV_INT_solid,SOLID_BBOX)
		entity_set_int(ent,EV_INT_movetype,MOVETYPE_FLY)
		
		entity_set_size(ent,Float:{-0.5,-0.5,-0.5},Float:{0.5,0.5,0.5})
		
		entity_set_vector(ent,EV_VEC_velocity,velocity)
		
		vector_to_angle(velocity,angles)
		entity_set_vector(ent,EV_VEC_angles,angles)
		
		entity_set_edict(ent,EV_ENT_owner,id)
		
		entity_set_int(ent,EV_INT_effects,entity_get_int(ent,EV_INT_effects) | EF_LIGHT)
		
		entity_set_origin(ent,origin)
		
		message_begin(MSG_BROADCAST,SVC_TEMPENTITY)
		write_byte(TE_BEAMFOLLOW)
		write_short(ent)
		write_short(sprite_beamcylinder)
		write_byte(30)
		write_byte(5)
		write_byte(255)
		write_byte(255)
		write_byte(255)
		write_byte(140)
		message_end()
	}
	
	set_task(get_pcvar_float(cvar_reload_time),"action_reload_user_jetpack",id)
}

public action_fly_user_jetpack(id)
{
	new Float:velocity[3]
	velocity_by_aim(id,get_pcvar_num(cvar_aimvelocity),velocity)
	velocity[2] += float(get_pcvar_num(cvar_zvelocity))
	entity_set_vector(id,EV_VEC_velocity,velocity)
	
	energy[id] -= get_pcvar_num(cvar_remove_energy)
	if(energy[id] < 1) energy[id] = 0
	
	set_hudmessage(255, 0, 0, -1.0, 0.29, 0, 6.0, 1.0, 0.1, 0.2, -1)
	ShowSyncHudMsg(id,hudsync,"Jetpack Energy: [%i / %i]",energy[id],get_pcvar_num(cvar_start_energy))
	
	emit_sound(id,CHAN_AUTO,"jetpack.wav",VOL_NORM,ATTN_NORM,0,PITCH_NORM)
	
	message_begin(MSG_BROADCAST,SVC_TEMPENTITY)
	write_byte(TE_KILLBEAM)
	write_short(id)
	message_end()
	
	if(entity_get_int(id,EV_INT_flags) & FL_INWATER) return
	
	message_begin(MSG_BROADCAST,SVC_TEMPENTITY)
	write_byte(TE_BEAMFOLLOW)
	write_short(id)
	write_short(sprite_beamcylinder)
	write_byte(25)
	write_byte(10)
	write_byte(0)
	write_byte(255)
	write_byte(0)
	write_byte(175)
	message_end()
}

public action_reload_user_jetpack(id)
{
	if(!is_user_connected(id) || !has_jetpack[id]) return
	can_shoot[id] = true
	
	client_print(id,print_center,"[VECJP] Your jetpack has been reloaded. Now you can shoot again!")
}

public get_jetpack(ent,id)
{
	if(has_jetpack[id] || zp_get_user_zombie(id) || zp_get_user_nemesis(id)) return
	
	remove_task(id)
	
	has_jetpack[id] = true
	can_shoot[id] = false
	energy[id] = entity_get_int(ent,EV_INT_iuser1)
	
	emit_sound(id,CHAN_AUTO,"items/gunpickup2.wav",VOL_NORM,ATTN_NORM,0,PITCH_NORM)
	
	client_cmd(id,"weapon_knife")
	
	entity_set_string(id,EV_SZ_viewmodel,"models/v_egon.mdl")
	entity_set_string(id,EV_SZ_weaponmodel,"models/p_egon.mdl")
	
	set_task(get_pcvar_float(cvar_reload_time),"action_reload_user_jetpack",id)
	set_task(get_pcvar_float(cvar_heal_time),"action_heal_user_jetpack",id)
	
	remove_entity(ent)
}

public touch_jetpack(world,ent)
{
	if(!is_valid_ent(ent)) return
	
	new Float:origin[3], origin_int[3], owner = entity_get_edict(ent,EV_ENT_owner)
	entity_get_vector(ent,EV_VEC_origin,origin)
	
	FVecIVec(origin,origin_int)
	
	new id = -1
	while((id = find_ent_in_sphere(id,origin,float(get_pcvar_num(cvar_radius)))) != 0)
	{
		if(!is_user_connected(owner)) break
		
		if(1 <= id <= maxplayers)
		{
			if(!zp_get_user_zombie(id) && !zp_get_user_nemesis(id)) continue
			ExecuteHamB(Ham_TakeDamage,id, owner,owner, float(get_pcvar_num(cvar_damage)), DMG_ALWAYSGIB)
		} else {
			if(!is_valid_ent(id)) continue
			
			new classname[15]
			entity_get_string(id,EV_SZ_classname,classname,14)
			
			if(!equal(classname,"func_breakable")) continue
			
			ExecuteHamB(Ham_TakeDamage,id, owner,owner, float(get_pcvar_num(cvar_damage)), DMG_ALWAYSGIB)
		}
	}
	
	message_begin(MSG_BROADCAST,SVC_TEMPENTITY,origin_int)
	write_byte(TE_EXPLOSION)
	write_coord(origin_int[0])
	write_coord(origin_int[1])
	write_coord(origin_int[2])
	write_short(sprite_explosion)
	write_byte(floatround(get_pcvar_num(cvar_radius) * 0.5))
	write_byte(10)
	write_byte(0)
	message_end()
	
	message_begin(MSG_BROADCAST,SVC_TEMPENTITY,origin_int)
	write_byte(TE_DLIGHT)
	write_coord(origin_int[0])
	write_coord(origin_int[1])
	write_coord(origin_int[2])
	write_byte(floatround(get_pcvar_num(cvar_radius) * 0.25))
	write_byte(200)
	write_byte(145)
	write_byte(0)
	write_byte(16)
	write_byte(32)
	message_end()
	
	message_begin(MSG_BROADCAST,SVC_TEMPENTITY,origin_int)
	write_byte(TE_BEAMCYLINDER)
	write_coord(origin_int[0])
	write_coord(origin_int[1])
	write_coord(origin_int[2])
	write_coord(origin_int[0])
	write_coord(origin_int[1])
	write_coord(origin_int[2] + get_pcvar_num(cvar_radius))
	write_short(sprite_beamcylinder)
	write_byte(0)
	write_byte(0)
	write_byte(10)
	write_byte(50)
	write_byte(0)
	write_byte(255)
	write_byte(255)
	write_byte(255)
	write_byte(160)
	write_byte(0)
	message_end()
	
	remove_entity(ent)
}

public hook_death()
{
	new id = read_data(2)
	action_remove_user_jetpack(id)
}

public action_remove_user_jetpack(id)
{
	if(get_pcvar_num(cvar_can_drop))
	{
		if(has_jetpack[id] && get_user_weapon(id) == CSW_KNIFE) action_drop_user_jetpack(id)
		
		has_jetpack[id] = false
		can_shoot[id] = false
		energy[id] = 0
		
		message_begin(MSG_BROADCAST,SVC_TEMPENTITY)
		write_byte(TE_KILLBEAM)
		write_short(id)
		message_end()
	} else {
		has_jetpack[id] = false
		can_shoot[id] = false
		energy[id] = 0
	}
}

public event_curweapon(id)
{
	if(has_jetpack[id] && !zp_get_user_zombie(id))
	{
		entity_set_string(id,EV_SZ_viewmodel,"models/v_egon.mdl")
		entity_set_string(id,EV_SZ_weaponmodel,"models/p_egon.mdl")
	}
}

public round_end()
{
	remove_entity_name("weapon_jetpack")
	
	if(get_pcvar_num(cvar_one_round))
	{
		for(new i=1;i<maxplayers;i++)
		{
			if(is_user_connected(i))
			{
				has_jetpack[i] = false
				can_shoot[i] = false
				energy[i] = 0
			}
		}
	}
}

public client_connect(id) has_jetpack[id] = false
public client_disconnect(id) has_jetpack[id] = false
Последно промяна от You Owe Me на 12 Юли 2018, 12:01, променено общо 1 път.
I am actually not a Harry Potter FAN, but this song below is HOT AF :crazy:

Аватар
2MF4TH
Извън линия
Потребител
Потребител
Мнения: 6
Регистриран на: 07 Юли 2018, 12:03
Местоположение: Хасково
Се отблагодари: 2 пъти

Ужасен бъг със плъгина JETPACK VECO + Crash на плъгина ZP Minigun

Мнение от 2MF4TH » 11 Юли 2018, 19:45

Код за потвърждение: Избери целия код

#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>
#include <engine>
#include <cstrike>
#include <zombieplague>

new sprite_explosion,sprite_beamcylinder, jp_itemid,
cvar_cost,cvar_damage,cvar_speed,cvar_reload_time,cvar_radius,
cvar_start_energy,cvar_remove_energy,cvar_heal_energy,cvar_heal_time,cvar_zvelocity,cvar_aimvelocity,
cvar_can_drop,cvar_one_round,
maxplayers,hudsync, has_jetpack[33],can_shoot[33],energy[33]
public plugin_precache()
{
	precache_model("models/v_egon.mdl")
	precache_model("models/p_egon.mdl")
	precache_model("models/w_egon.mdl")
	
	precache_model("models/rpgrocket.mdl")
	
	sprite_explosion = precache_model("sprites/zerogxplode.spr")
	sprite_beamcylinder = precache_model("sprites/white.spr")
	
	precache_sound("weapons/rocketfire1.wav")
	precache_sound("common/bodydrop2.wav")
	precache_sound("items/gunpickup2.wav")
	precache_sound("jetpack.wav")
}

public plugin_init() {
	register_plugin("[ZP] Extra Item: Jetpack + Bazooka", "1.1", "<VeCo>")
	
	cvar_cost = register_cvar("vecjp_cost","35")
	cvar_speed = register_cvar("vecjp_rocket_speed","800")
	cvar_damage = register_cvar("vecjp_damage","800")
	cvar_reload_time = register_cvar("vecjp_reload_time","10.0")
	cvar_radius = register_cvar("vecjp_radius","150")
	cvar_start_energy = register_cvar("vecjp_start_energy","200")
	cvar_remove_energy = register_cvar("vecjp_remove_energy","1")
	cvar_heal_energy = register_cvar("vecjp_heal_energy","10")
	cvar_heal_time = register_cvar("vecjp_heal_time","1.0")
	cvar_zvelocity = register_cvar("vecjp_zvelocity","300")
	cvar_aimvelocity = register_cvar("vecjp_aimvelocity","300")
	cvar_can_drop = register_cvar("vecjp_can_drop","1")
	cvar_one_round = register_cvar("vecjp_one_round","0")
	
	jp_itemid = zp_register_extra_item("Jetpack + bazooka",get_pcvar_num(cvar_cost),ZP_TEAM_HUMAN)
	
	register_clcmd("drop","drop_jetpack")
	
	RegisterHam(Ham_Weapon_SecondaryAttack,"weapon_knife","shoot_jetpack")
	RegisterHam(Ham_Player_Jump,"player","fly_jetpack")
	
	register_touch("weapon_jetpack","player","get_jetpack")
	register_touch("","info_jetpack_rocket","touch_jetpack")
	
	register_event("DeathMsg","hook_death","a")
	register_event("CurWeapon","event_curweapon","be","1=1","2=29")
	
	register_logevent("round_end",2,"1=Round_End")
	
	maxplayers = get_maxplayers()
	hudsync = CreateHudSyncObj()
}

public zp_extra_item_selected(id,itemid)
{
	if(itemid != jp_itemid) return
	
	if(has_jetpack[id])
	{
		client_print(id,print_chat,"[VECJP] You have already own a jetpack.")
		return
	}
	
	has_jetpack[id] = true
	can_shoot[id] = true
	energy[id] = get_pcvar_num(cvar_start_energy)
	
	emit_sound(id,CHAN_AUTO,"items/gunpickup2.wav",VOL_NORM,ATTN_NORM,0,PITCH_NORM)
	
	client_cmd(id,"weapon_knife")
	
	entity_set_string(id,EV_SZ_viewmodel,"models/v_egon.mdl")
	entity_set_string(id,EV_SZ_weaponmodel,"models/p_egon.mdl")
	
	set_task(get_pcvar_float(cvar_heal_time),"action_heal_user_jetpack",id)
}

public drop_jetpack(id) if(get_pcvar_num(cvar_can_drop) && get_user_weapon(id) == CSW_KNIFE && has_jetpack[id]) action_drop_user_jetpack(id)

public shoot_jetpack(ent)
{
	new id = entity_get_edict(ent,EV_ENT_owner)
	if(!has_jetpack[id]) return HAM_IGNORED
	
	if(!can_shoot[id])
	{
		client_print(id,print_center,"[VECJP] You can't shoot with the jetpack right now. Please wait...")
		return HAM_IGNORED
	}
	
	action_shoot_user_jetpack(id)
	
	return HAM_IGNORED
}

public fly_jetpack(id)
{
	if(!has_jetpack[id]) return HAM_IGNORED
	
	if(!energy[id])
	{
		client_print(id,print_center,"[VECJP] You don't have enough energy to fly.")
		return HAM_IGNORED
	}
	
	if(get_user_button(id) & IN_DUCK) action_fly_user_jetpack(id)
	
	return HAM_IGNORED
}

public action_heal_user_jetpack(id)
{
	if(!is_user_connected(id) || !has_jetpack[id]) return
	
	if(zp_get_user_zombie(id) || zp_get_user_nemesis(id))
	{
		action_remove_user_jetpack(id)
		return
	}
	
	if(entity_get_int(id,EV_INT_flags) & FL_INWATER)
	{
		message_begin(MSG_BROADCAST,SVC_TEMPENTITY)
		write_byte(TE_KILLBEAM)
		write_short(id)
		message_end()
	}
	
	if(entity_get_int(id,EV_INT_flags) & FL_ONGROUND)
	{
		message_begin(MSG_BROADCAST,SVC_TEMPENTITY)
		write_byte(TE_KILLBEAM)
		write_short(id)
		message_end()
		
		if(energy[id] < get_pcvar_num(cvar_start_energy))
		{
			energy[id] += get_pcvar_num(cvar_heal_energy)
			if(energy[id] > get_pcvar_num(cvar_start_energy)) energy[id] = get_pcvar_num(cvar_start_energy)
			
			set_hudmessage(255, 0, 0, -1.0, 0.29, 0, 6.0, 1.0, 0.1, 0.2, -1)
			ShowSyncHudMsg(id,hudsync,"Jetpack Energy: [%i / %i]",energy[id],get_pcvar_num(cvar_start_energy))
		}
	}
	
	set_task(get_pcvar_float(cvar_heal_time),"action_heal_user_jetpack",id)
}

public action_drop_user_jetpack(id)
{
	remove_task(id)
	
	has_jetpack[id] = false
	can_shoot[id] = false
	
	message_begin(MSG_BROADCAST,SVC_TEMPENTITY)
	write_byte(TE_KILLBEAM)
	write_short(id)
	message_end()
	
	emit_sound(id,CHAN_AUTO,"common/bodydrop2.wav",VOL_NORM,ATTN_NORM,0,PITCH_NORM)
	
	new ent = create_entity("info_target")
	if(ent)
	{
		new Float:origin[3],Float:velocity[3]
		
		entity_get_vector(id,EV_VEC_origin,origin)
		velocity_by_aim(id,60,velocity)
		
		origin[0] += velocity[0]
		origin[1] += velocity[1]
		
		entity_set_string(ent,EV_SZ_classname,"weapon_jetpack")
		entity_set_model(ent,"models/w_egon.mdl")
		
		entity_set_int(ent,EV_INT_solid,SOLID_TRIGGER)
		entity_set_int(ent,EV_INT_movetype,MOVETYPE_TOSS)
		
		entity_set_int(ent,EV_INT_iuser1,energy[id])
		
		entity_set_float(ent,EV_FL_gravity,1.0)
		
		entity_set_origin(ent,origin)
	}
	
	energy[id] = 0
}

public action_shoot_user_jetpack(id)
{
	can_shoot[id] = false
	
	emit_sound(id,CHAN_AUTO,"weapons/rocketfire1.wav",VOL_NORM,ATTN_NORM,0,PITCH_NORM)
	
	new ent = create_entity("info_target")
	if(ent)
	{
		new Float:origin[3],Float:velocity[3],Float:angles[3]
		
		entity_get_vector(id,EV_VEC_origin,origin)
		velocity_by_aim(id,60,velocity)
		
		origin[0] += velocity[0]
		origin[1] += velocity[1]
		
		velocity[0] = 0.0
		velocity[1] = 0.0
		
		velocity_by_aim(id,get_pcvar_num(cvar_speed),velocity)
		
		entity_set_string(ent,EV_SZ_classname,"info_jetpack_rocket")
		entity_set_model(ent,"models/rpgrocket.mdl")
		
		entity_set_int(ent,EV_INT_solid,SOLID_BBOX)
		entity_set_int(ent,EV_INT_movetype,MOVETYPE_FLY)
		
		entity_set_size(ent,Float:{-0.5,-0.5,-0.5},Float:{0.5,0.5,0.5})
		
		entity_set_vector(ent,EV_VEC_velocity,velocity)
		
		vector_to_angle(velocity,angles)
		entity_set_vector(ent,EV_VEC_angles,angles)
		
		entity_set_edict(ent,EV_ENT_owner,id)
		
		entity_set_int(ent,EV_INT_effects,entity_get_int(ent,EV_INT_effects) | EF_LIGHT)
		
		entity_set_origin(ent,origin)
		
		message_begin(MSG_BROADCAST,SVC_TEMPENTITY)
		write_byte(TE_BEAMFOLLOW)
		write_short(ent)
		write_short(sprite_beamcylinder)
		write_byte(30)
		write_byte(5)
		write_byte(255)
		write_byte(255)
		write_byte(255)
		write_byte(140)
		message_end()
	}
	
	set_task(get_pcvar_float(cvar_reload_time),"action_reload_user_jetpack",id)
}

public action_fly_user_jetpack(id)
{
	new Float:velocity[3]
	velocity_by_aim(id,get_pcvar_num(cvar_aimvelocity),velocity)
	velocity[2] += float(get_pcvar_num(cvar_zvelocity))
	entity_set_vector(id,EV_VEC_velocity,velocity)
	
	energy[id] -= get_pcvar_num(cvar_remove_energy)
	if(energy[id] < 1) energy[id] = 0
	
	set_hudmessage(255, 0, 0, -1.0, 0.29, 0, 6.0, 1.0, 0.1, 0.2, -1)
	ShowSyncHudMsg(id,hudsync,"Jetpack Energy: [%i / %i]",energy[id],get_pcvar_num(cvar_start_energy))
	
	emit_sound(id,CHAN_AUTO,"jetpack.wav",VOL_NORM,ATTN_NORM,0,PITCH_NORM)
	
	message_begin(MSG_BROADCAST,SVC_TEMPENTITY)
	write_byte(TE_KILLBEAM)
	write_short(id)
	message_end()
	
	if(entity_get_int(id,EV_INT_flags) & FL_INWATER) return
	
	message_begin(MSG_BROADCAST,SVC_TEMPENTITY)
	write_byte(TE_BEAMFOLLOW)
	write_short(id)
	write_short(sprite_beamcylinder)
	write_byte(25)
	write_byte(10)
	write_byte(255)
	write_byte(255)
	write_byte(255)
	write_byte(175)
	message_end()
}

public action_reload_user_jetpack(id)
{
	if(!is_user_connected(id) || !has_jetpack[id]) return
	can_shoot[id] = true
	
	client_print(id,print_center,"[VECJP] Your jetpack has been reloaded. Now you can shoot again!")
}

public get_jetpack(ent,id)
{
	if(has_jetpack[id] || zp_get_user_zombie(id) || zp_get_user_nemesis(id)) return
	
	remove_task(id)
	
	has_jetpack[id] = true
	can_shoot[id] = false
	energy[id] = entity_get_int(ent,EV_INT_iuser1)
	
	emit_sound(id,CHAN_AUTO,"items/gunpickup2.wav",VOL_NORM,ATTN_NORM,0,PITCH_NORM)
	
	client_cmd(id,"weapon_knife")
	
	entity_set_string(id,EV_SZ_viewmodel,"models/v_egon.mdl")
	entity_set_string(id,EV_SZ_weaponmodel,"models/p_egon.mdl")
	
	set_task(get_pcvar_float(cvar_reload_time),"action_reload_user_jetpack",id)
	set_task(get_pcvar_float(cvar_heal_time),"action_heal_user_jetpack",id)
	
	remove_entity(ent)
}

public touch_jetpack(world,ent)
{
	if(!is_valid_ent(ent)) return
	
	new Float:origin[3], origin_int[3], owner = entity_get_edict(ent,EV_ENT_owner)
	entity_get_vector(ent,EV_VEC_origin,origin)
	
	FVecIVec(origin,origin_int)
	
	new id = -1
	while((id = find_ent_in_sphere(id,origin,float(get_pcvar_num(cvar_radius)))) != 0)
	{
		if(!is_user_connected(owner)) break
		
		if(1 <= id <= maxplayers)
		{
			if(!zp_get_user_zombie(id) && !zp_get_user_nemesis(id)) continue
			ExecuteHamB(Ham_TakeDamage,id, owner,owner, float(get_pcvar_num(cvar_damage)), DMG_ALWAYSGIB)
		} else {
			if(!is_valid_ent(id)) continue
			
			new classname[15]
			entity_get_string(id,EV_SZ_classname,classname,14)
			
			if(!equal(classname,"func_breakable")) continue
			
			ExecuteHamB(Ham_TakeDamage,id, owner,owner, float(get_pcvar_num(cvar_damage)), DMG_ALWAYSGIB)
		}
	}
	
	message_begin(MSG_BROADCAST,SVC_TEMPENTITY,origin_int)
	write_byte(TE_EXPLOSION)
	write_coord(origin_int[0])
	write_coord(origin_int[1])
	write_coord(origin_int[2])
	write_short(sprite_explosion)
	write_byte(floatround(get_pcvar_num(cvar_radius) * 0.5))
	write_byte(10)
	write_byte(0)
	message_end()
	
	message_begin(MSG_BROADCAST,SVC_TEMPENTITY,origin_int)
	write_byte(TE_DLIGHT)
	write_coord(origin_int[0])
	write_coord(origin_int[1])
	write_coord(origin_int[2])
	write_byte(floatround(get_pcvar_num(cvar_radius) * 0.25))
	write_byte(200)
	write_byte(145)
	write_byte(0)
	write_byte(16)
	write_byte(32)
	message_end()
	
	message_begin(MSG_BROADCAST,SVC_TEMPENTITY,origin_int)
	write_byte(TE_BEAMCYLINDER)
	write_coord(origin_int[0])
	write_coord(origin_int[1])
	write_coord(origin_int[2])
	write_coord(origin_int[0])
	write_coord(origin_int[1])
	write_coord(origin_int[2] + get_pcvar_num(cvar_radius))
	write_short(sprite_beamcylinder)
	write_byte(0)
	write_byte(0)
	write_byte(10)
	write_byte(50)
	write_byte(0)
	write_byte(255)
	write_byte(255)
	write_byte(255)
	write_byte(160)
	write_byte(0)
	message_end()
	
	remove_entity(ent)
}

public hook_death()
{
	new id = read_data(2)
	action_remove_user_jetpack(id)
}

public action_remove_user_jetpack(id)
{
	if(get_pcvar_num(cvar_can_drop))
	{
		if(has_jetpack[id] && get_user_weapon(id) == CSW_KNIFE) action_drop_user_jetpack(id)
		
		has_jetpack[id] = false
		can_shoot[id] = false
		energy[id] = 0
		
		message_begin(MSG_BROADCAST,SVC_TEMPENTITY)
		write_byte(TE_KILLBEAM)
		write_short(id)
		message_end()
	} else {
		has_jetpack[id] = false
		can_shoot[id] = false
		energy[id] = 0
	}
}

public event_curweapon(id)
{
	if(has_jetpack[id] && !zp_get_user_zombie(id))
	{
		entity_set_string(id,EV_SZ_viewmodel,"models/v_egon.mdl")
		entity_set_string(id,EV_SZ_weaponmodel,"models/p_egon.mdl")
	}
}

public round_end()
{
	remove_entity_name("weapon_jetpack")
	
	if(get_pcvar_num(cvar_one_round))
	{
		for(new i=1;i<maxplayers;i++)
		{
			if(is_user_connected(i))
			{
				has_jetpack[i] = false
				can_shoot[i] = false
				energy[i] = 0
			}
		}
	}
}

public client_connect(id) has_jetpack[id] = false
public client_disconnect(id) has_jetpack[id] = false
Последно промяна от 2MF4TH на 11 Юли 2018, 19:46, променено общо 1 път.

Аватар
You Owe Me
Извън линия
Потребител
Потребител
Мнения: 185
Регистриран на: 07 Мар 2018, 19:34
Местоположение: Пред компютъра
Получена благодарност: 2 пъти

Ужасен бъг със плъгина JETPACK VECO + Crash на плъгина ZP Minigun

Мнение от You Owe Me » 11 Юли 2018, 23:04

Сега ще пробвам.

Добавено преди 3 часа 18 минути 30 секунди:
За жалост пак бъгва...
I am actually not a Harry Potter FAN, but this song below is HOT AF :crazy:

Аватар
User12
Извън линия
Потребител
Потребител
Мнения: 321
Регистриран на: 25 Яну 2018, 22:39
Местоположение: Сливен
Се отблагодари: 40 пъти
Получена благодарност: 17 пъти
Обратна връзка:

Ужасен бъг със плъгина JETPACK VECO + Crash на плъгина ZP Minigun

Мнение от User12 » 11 Юли 2018, 23:31

Някаква грешка в конзолата има ли ? дай малко повече информация , за да крашва трябва да записва грешка .
Каналът ми в YouTube : Георги Пламенов

Изображение

Аватар
You Owe Me
Извън линия
Потребител
Потребител
Мнения: 185
Регистриран на: 07 Мар 2018, 19:34
Местоположение: Пред компютъра
Получена благодарност: 2 пъти

Ужасен бъг със плъгина JETPACK VECO + Crash на плъгина ZP Minigun

Мнение от You Owe Me » 11 Юли 2018, 23:37

Segmentation fault... Между другото jetpack-а ми е по-важен да се оправи.. :/
I am actually not a Harry Potter FAN, but this song below is HOT AF :crazy:

Аватар
User12
Извън линия
Потребител
Потребител
Мнения: 321
Регистриран на: 25 Яну 2018, 22:39
Местоположение: Сливен
Се отблагодари: 40 пъти
Получена благодарност: 17 пъти
Обратна връзка:

Ужасен бъг със плъгина JETPACK VECO + Crash на плъгина ZP Minigun

Мнение от User12 » 11 Юли 2018, 23:43

тоя плъгин от къде си го теглил , тая версия е толкова стара , че не е за вярване просто . освен това "Segmentation fault" нещо друго цифри букжи няма ли във логовете какво изписва или е празно там ?
Каналът ми в YouTube : Георги Пламенов

Изображение

Аватар
You Owe Me
Извън линия
Потребител
Потребител
Мнения: 185
Регистриран на: 07 Мар 2018, 19:34
Местоположение: Пред компютъра
Получена благодарност: 2 пъти

Ужасен бъг със плъгина JETPACK VECO

Мнение от You Owe Me » 12 Юли 2018, 12:02

Това го оправих, сега моля някой да ми даде fix-нат код на jetpack veco плъгина... Постоянно бъгва
I am actually not a Harry Potter FAN, but this song below is HOT AF :crazy:

Аватар
WaLkZ
Извън линия
Администратор
Администратор
Мнения: 799
Регистриран на: 05 Окт 2016, 21:13
Местоположение: Варна
Се отблагодари: 75 пъти
Получена благодарност: 227 пъти
Обратна връзка:

Ужасен бъг със плъгина JETPACK VECO

Мнение от WaLkZ » 12 Юли 2018, 14:25

You Owe Me написа: 12 Юли 2018, 12:02 Това го оправих, сега моля някой да ми даде fix-нат код на jetpack veco плъгина... Постоянно бъгва
Дай повече информация за сървъра си. Както и като бъгне, някакви грешки хвърля ли в конзолата?

Аватар
You Owe Me
Извън линия
Потребител
Потребител
Мнения: 185
Регистриран на: 07 Мар 2018, 19:34
Местоположение: Пред компютъра
Получена благодарност: 2 пъти

Ужасен бъг със плъгина JETPACK VECO

Мнение от You Owe Me » 12 Юли 2018, 14:41

Protocol version 48
Exe version 1.1.2.7/Stdio (cstrike)
ReHLDS version: 3.4.0.639-dev
Build date: 17:47:13 Feb 21 2018 (1411)
Build from: https://github.com/dreamstalker/rehlds/commit/822df9a
Версия на мода: 4.3
ZP Plugins:

Код за потвърждение: Избери целия код

; - Quick tips -

; * Rename this file to disabled-zplague.ini to turn the mod off

; * Rename it back to plugins-zplague.ini to turn it on

; * Put a semi-colon in front of a plugin to disable it

; * Remove a semi-colon to re-enable a plugin

; * Add the word debug after a plugin to place it in debug mode



; Main plugin

zombie_plague40.amxx debug					; glaven plugin



; Zombie classes

;zp_zclasses40.amxx
zp_zclass_hunter.amxx debug
zp_zclass_fast.amxx debug
zp_zclass_jump.amxx debug
zp_zclass_fat.amxx debug
zp_zclass_rage.amxx debug
zp_zclass_swarm.amxx debug


; Addons

eventap.amxx debug
zp_vip.amxx debug
;zp_parachute.amxx debug						; bezplaten parashut za vsichki s custom model
;zp_score.amxx debug							; nai-gore ima golqm HUD koito pokazva rezultata
zp_countdown.amxx debug						; broene do infekciqta (hud + custom sound)
zp_ua_uaio_veco.amxx debug					; zapazvane na dannite (na amoto) s nvault
zp_addon_grenade_status.amxx debug			; pokazva v lqvo s iconka kakva granata durjish
;GHW_Weapon_Replacement.amxx debug			; weapon models (new_weapons.ini)
zp_sub_parachute.amxx debug
getammopacks.amxx debug
zp_choose_weapons_survivor.amxx debug
zp_respawn.amxx debug
zp_addon_simple_ap_limit.amxx debug
zp_addons_last_human_pain_free.amxx debug
zp_no_engine_knockback.amxx debug

; Extra Items

zp_extra_multijump.amxx debug				; ekstra item dvoen skok (zp_extraitems.ini)
zp_extra_jetpack_bazooka32.amxx debug
zp_extra_goldenak.amxx debug				; ekstra item golden deagle
;zp_jetpack_veco.amxx debug
zp_extra_human_armor.amxx debug
zp_extra_knife_blink.amxx debug
;zp_lasermine_28.amxx debug
zp_lasermine_perfect_4.2.amxx debug
zp_no_recoil.amxx debug
zp_extra_zspawn.amxx debug
;zp_extra_minigun.amxx debug
com4o_vip_extra_buy_survnem.amxx debug
com4o_vip_extra_playeraura.amxx debug
com4o_vip_extra_human_armor.amxx debug
Normal Plugins:

Код за потвърждение: Избери целия код

advanced_bans.amxx debug

gag_system.amxx debug ; amx_gagmenu
;deagsmapmanager.amxx debug
anti-advertise.amxx debug

crx_chatmanager.amxx debug ; admin prefixi (nastroivat se ot configs/ChatManager.ini + nastroikata na chata sushto e tam: FORMAT_SAY i FORMAT_SAY_TEAM)
crx_chatmanager_toggle.amxx debug

;reaimdetector.amxx debug 

admin.amxx			; razpoznava adminite ot users.ini (ili ot sql-a)
;admin_sql.amxx		; razhirenie na admin.amxx i vmesto ot users.ini vzima ot sql.cfg
admincmd.amxx		; admin komandite (amx_slay, amx_kick i prochie)
adminslots.amxx		; slot reservation
menufront.amxx		; amxmodmenu
cmdmenu.amxx		; Amxmodx: Command menu -> speech, settings
plmenu_ab_base.amxx debug
;plmenu.amxx			; Players menu (kick, ban)
mapsmenu.amxx		; Amxmodx: Maps menu -> vote, changelevel
pluginmenu.amxx		; Amxmodx: Plugins Menu (nastrika na cvarite v igra)
adminchat.amxx		; amx_psay, amx_tsay, say @, say @@ i prochie
antiflood.amxx		; protiv spama v chata
adminvote.amxx		; amx_vote
dmc233.amxx debug	; mapchooser + nextmap + timeleft (Nastroiki v configs/dmc/..)
;pausecfg.amxx		; Amxmodx: Pause Menu (amx_pausecfg): Moje da pauzira pluginite
statscfg.amxx		; Amxmodx: 9(more) i posle 5. Stats Menu (puska/spira nqkoi nastroiki kato /me, /top i prochie)
;restmenu.amxx		; Amxmodx: 9(more) i posle Restric Menu (puska/spira kupuvaneto na nqkoi orujiq)
statsx_shell.amxx debug ; rashireni statistiki, s po-gotin stil na topa i colorchat (conifgs/statsx_shell)
;statsx.amxx			; statistiki za igrata: primer kato v kraq na runda hud koi ima nai-mnogo demidj
;miscstats.amxx		; Multi Kill hud + sound, 1vs1 hud + sound i prochie (nastroiva se ot Stats Menu

ad_manager.amxx debug 
;crx_remusic.amxx debug
crx_demorecorder.amxx debug		; demo recorder (redaktirat se saobshteniqta ot amxx.cfg)
crx_showip.amxx debug			; amx_showip (redaktira se ot configs/IPshower.ini)
crx_simplers_reapi.amxx debug	; reset score (redaktirat se suobshtenqita ot amxx.cfg)
quakesounds.amxx debug 			; dopylnitelni zvuci
crx_motdcommands.amxx debug
crx_remove_immunity.amxx debug
nademodes.amxx debug
pingfaker.amxx debug
floatingweapons.amxx debug
potti.amxx debug
advanced_weapon_tracers.amxx debug
bullet_damage.amxx debug
backweapons.amxx debug
vipconnected.amxx debug
Грешки - никакви, изведнъж става това... След като пре-компилирам и заместя стария със новия се оправя, и няколко карти или рунда по-късно се бъгва, като изстреляш ракетата веднага гърми, тоест гърми точно пред собственика...
I am actually not a Harry Potter FAN, but this song below is HOT AF :crazy:

Аватар
You Owe Me
Извън линия
Потребител
Потребител
Мнения: 185
Регистриран на: 07 Мар 2018, 19:34
Местоположение: Пред компютъра
Получена благодарност: 2 пъти

Ужасен бъг със плъгина JETPACK VECO

Мнение от You Owe Me » 12 Юли 2018, 22:10

Сложих друг плъгин, мисля, че версията му беше 3.2, нямам го същия проблем с него, но тази версия е крайно по-неудобна от тази на Веко, затова пуснах заявка да се поправи този, защото той е най-добрият jetpack плъгин (мое мнение), но този проклет бъг ме спира от това да го ползвам, за жалост. @OciXCrom , @Walkz вие сте ми надеждата! Или някой който има познания от мода.
I am actually not a Harry Potter FAN, but this song below is HOT AF :crazy:

Заключено
  • Подобни теми
    Отговори
    Преглеждания
     Последно мнение

Обратно към “Заявки за плъгини”

Кой е на линия

Потребители разглеждащи този форум: Google [Bot] и 12 госта