Raised This Month: $51 Target: $400
 12% 

I'll pay for the job


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
justafa.mustafa
Junior Member
Join Date: Aug 2019
Old 11-06-2019 , 13:53   I'll pay for the job
Reply With Quote #1

I'll pay the man money,
which will fix this plugin for me, pm.
These plugin have errors,
with this plugin server crashing all days,
without errors log, any errors with debug mode.
IF plugin remove from plugins.ini server stops crashing.



HTML Code:
#include <amxmodx>
#include <amxmisc>
#include <xs>
#include <fakemeta_util>
#include <engine>
#include <hamsandwich>
#include <fun>
#include <hl>

#define PLUGIN "power play (HL)"
#define VERSION "2013-12-22*"
#define AUTHOR "author unknown anonym"

#define HLFW_CROWBAR "fly_crowbar"
#define HLFW_HANDGRENADE "fly_handgrenade"
#define SPEED 0.10
#define is_player(%1) (1 <= %1 <= maxplayers)
#define refill_weapon(%1,%2) set_pdata_int(%1, m_iClip, %2, m_linuxoffset4)
#define InZoom(%1) (get_pdata_int(%1, m_iFOV) != 0)

const SPAWNFLAGS = 768
const WEAPON_CROWBAR = 1
const WEAPON_SNARK = 15
const m_linuxoffset5 = 5
const m_linuxoffset4 = 4
const m_maxitemtypes = 6
const m_pPlayer = 28
const m_pNext = 29
const m_iId = 30
const m_fInSpecialReload = 34
const m_flNextPrimaryAttack = 35
const m_flNextSecondaryAttack = 36
const m_flTimeWeaponIdle = 37
const m_iClip = 40
const m_iDefaultAmmo = 44
const m_flNextAttack = 148
const m_iFOV = 298
const m_rgpPlayerItems_Slot0 = 300
const m_pActiveItem = 306
const m_rgAmmo_Slot0 = 309
const GRENADE_AMMO = 319
const DMG_CROSSBOW  = (DMG_BULLET | DMG_NEVERGIB)

new Float:origin[3], Float:angles[3], Float:vec[3], Float:v_forward[3], Float:v_right[3], 
Float:v_up[3], Float:viewOfs[3], old_clip[33], old_special_reload[33], zoom[33], 
Float: fov, glock[33], BlockSound, maxplayers, weapon, blood_drop, blood_spray, 
SpawnID[64]

static const ammo_clip[] = {0, 0, 17, 6, 50, 5, 5, 8, 3, 0, 0, 0, 0, 0, 0, 0}
static iId, weapon_name[19]

public plugin_init()
{
	register_plugin(PLUGIN, VERSION, AUTHOR)

	maxplayers = get_maxplayers()

	register_forward(FM_CmdStart, "CmdStart")

	RegisterHam(Ham_Spawn, "player", "client_putinserver",1)
	RegisterHam(Ham_Spawn, "weaponbox", "kill_weaponbox", 1)

	RegisterHam(Ham_Item_AddToPlayer, "weapon_9mmAR", "fw_MP5_Add")
	RegisterHam(Ham_Item_AddDuplicate, "weapon_9mmAR", "fw_MP5_Add")

	RegisterHam(Ham_Killed, "player", "attacker_weapon", 1)
	RegisterHam(Ham_TraceAttack, "player", "Forward_TraceAttack")
	RegisterHam(Ham_TraceAttack, "player", "TraceAttack")

	RegisterHam(Ham_Item_Deploy, "weapon_9mmhandgun", "item_deploy", 1)
	RegisterHam(Ham_Item_Holster, "weapon_9mmhandgun", "item_holster", 1)

	RegisterHam(Ham_Weapon_PrimaryAttack, "weapon_tripmine", "primary_attack_tripmine", 1)
	RegisterHam(Ham_Weapon_PrimaryAttack, "weapon_snark", "primary_attack_snark", 1)
	RegisterHam(Ham_Weapon_PrimaryAttack, "weapon_hornetgun", "primary_attack_hornetgun", 1)

	RegisterHam(Ham_Weapon_PrimaryAttack, "weapon_crowbar", "crowbar_primary_attack_post", 1)
	RegisterHam(Ham_Weapon_PrimaryAttack, "weapon_9mmhandgun", "glock_primary_attack_post", 1)
	RegisterHam(Ham_Weapon_PrimaryAttack, "weapon_357", "python_post", 1)
	RegisterHam(Ham_Weapon_PrimaryAttack, "weapon_rpg", "python_rpga", 1)
	RegisterHam(Ham_Weapon_PrimaryAttack, "weapon_shotgun", "shotgun_primary_attack_post", 1)
	RegisterHam(Ham_Weapon_PrimaryAttack, "weapon_crossbow", "crossbow_primary_attack_post", 1)

	new const _weapon_x2[][] = {"weapon_9mmhandgun", "weapon_shotgun", "weapon_357"}
	for(new a = 0; a <sizeof _weapon_x2; a++)
		RegisterHam(Ham_Weapon_PrimaryAttack, _weapon_x2[a], "primary_attack_pre", 0)

	RegisterHam(Ham_Weapon_SecondaryAttack, "weapon_9mmhandgun", "glock_secondary_attack")
	RegisterHam(Ham_Weapon_SecondaryAttack, "weapon_shotgun", "primary_attack_pre" , 0)
	RegisterHam(Ham_Weapon_SecondaryAttack, "weapon_shotgun", "shotgun_secondary_attack_post", 1)
	RegisterHam(Ham_Weapon_SecondaryAttack, "weapon_crossbow", "crossbow_secondary_attack_post", 1)
	RegisterHam(Ham_Weapon_SecondaryAttack, "weapon_satchel", "satchel_secondary_attack_post", 1)
	RegisterHam(Ham_Weapon_SecondaryAttack, "weapon_9mmAR", "grenades_secondary_attack_post", 1)
	RegisterHam(Ham_Weapon_SecondaryAttack, "weapon_crowbar", "SecondaryAttack_Crowbar",1)
	RegisterHam(Ham_Weapon_SecondaryAttack, "weapon_handgrenade","Grenade_Secondary_Attack_Pre", 0)
	RegisterHam(Ham_Weapon_SecondaryAttack, "weapon_handgrenade","Grenade_Secondary_Attack_Post", 1)

	RegisterHam(Ham_Weapon_Reload, "weapon_shotgun", "shotgun_reload_pre" , 0)
	RegisterHam(Ham_Weapon_Reload, "weapon_shotgun", "shotgun_reload_post", 1)
	RegisterHam(Ham_Weapon_Reload, "weapon_crossbow" , "crossbow_reload_post", 1)
	RegisterHam(Ham_Weapon_Reload, "weapon_9mmhandgun", "glock_reload")

	RegisterHam(Ham_Touch,"grenade","HandGrenade_Attack2_Touch",0)

	//crossfire blue room unlock, map teleports, enity remover
	some_functions()

	register_message(SVC_TEMPENTITY	, "msg_TempEntity")

	register_event("ItemPickup", "LongJump_Sound", "b", "1=item_longjump")

	register_message(get_user_msgid("DeathMsg"), "DeathMsg")
	
	register_think(HLFW_CROWBAR, "Weapon_think")
	register_touch(HLFW_CROWBAR, "*", "hlfw_crowbar_touch")

	register_clcmd("cheat_godmodee","godmode")
	register_clcmd("cheat_noclipp","noclip")

	new const _weapon_x3[][] = {"weapon_tripmine", "weapon_snark", "weapon_egon"}
	for(new b = 0; b <sizeof _weapon_x3; b++)
		RegisterHam(Ham_Weapon_SecondaryAttack, _weapon_x3[b], "TelePort",1)
}

public msg_TempEntity()
{
	static classname[32]
	
	if(get_msg_arg_int(1) != TE_BEAMFOLLOW)
		return PLUGIN_CONTINUE

	pev(get_msg_arg_int(2), pev_classname, classname, 31)

	if(!equal(classname, "hornet"))
		return PLUGIN_CONTINUE

	set_msg_arg_int(4, ARG_BYTE, 10)
	set_msg_arg_int(6, ARG_BYTE, 255)
	set_msg_arg_int(7, ARG_BYTE, 255)
	set_msg_arg_int(8, ARG_BYTE, 255)
	set_msg_arg_int(9, ARG_BYTE, 80)
	return PLUGIN_CONTINUE
}

public fw_MP5_Add(ent)
{
	if(pev_valid(ent) == 2 && get_pdata_int(ent, m_iDefaultAmmo, m_linuxoffset4))
	{
		set_pdata_int(ent, m_iDefaultAmmo, 50, m_linuxoffset4)
	}
}

public client_putinserver(id)
{
	if(is_user_alive(id))
	{
		hl_set_user_longjump(id, true, true)

		for(iId = WEAPON_CROWBAR; iId<=WEAPON_SNARK; iId++)
		{
			get_weaponname(iId, weapon_name, charsmax(weapon_name))
			Give_User_Weapon(id, weapon_name, iId)

			engclient_cmd(id, "weapon_gauss")
		}
	}
	return HAM_IGNORED
}

Give_User_Weapon(const id, const weapon[], const iId)
{
	static ent, ammo_type

	const URANIUM = 100
	const GLOCK = 250
	const PYTHON = 36
	const BUCKSHOT = 125
	const BOLT = 50
	const ROCKET = 5
	const HANDGRENADE = 15
	const SATCHEL = 10
	const TRIPMINE = 20
	const SNARK = 25
	const HORNET = 254
	const M203_GRENADE = 5

	static const max_ammo[] = 
	{0, 
		BUCKSHOT, GLOCK, M203_GRENADE, PYTHON, URANIUM, ROCKET, BOLT, TRIPMINE, SATCHEL, HANDGRENADE, SNARK, HORNET
	}

	if(!user_has_weapon(id, iId))
	{
		ent = fm_give_item(id, weapon)
	}

	else
	{
		for(new i=1; i<m_maxitemtypes; i++)
		{
			ent = get_pdata_cbase(id, m_rgpPlayerItems_Slot0 + i, m_linuxoffset5)

			while(pev_valid(ent))
        		{
            			if(get_pdata_int(ent, m_iId, m_linuxoffset4) == iId)
            			{
                			goto set_bpammo
            			}

            			ent = get_pdata_cbase(ent, m_pNext, m_linuxoffset4)
			}
		}
	}

	set_bpammo:

	if(ent > 0)
	{
		ammo_type = ExecuteHam(Ham_Item_PrimaryAmmoIndex, ent)

		if(ammo_type > -1)
		{
			set_pdata_int(id, m_rgAmmo_Slot0 + ammo_type, max_ammo[ammo_type], m_linuxoffset5)

		}

		ammo_type = ExecuteHam(Ham_Item_SecondaryAmmoIndex, ent)

		if(ammo_type > -1)
		{
			set_pdata_int(id, m_rgAmmo_Slot0 + ammo_type, max_ammo[ammo_type], m_linuxoffset5)
		}
	}

}

public kill_weaponbox(ent)
{
	set_pev(ent, pev_flags, FL_KILLME)
}

public attacker_weapon(const victim, const attacker, const shouldgib) 
{
	if(is_player(attacker) && victim != attacker && is_user_alive(attacker))
	{
		weapon = get_user_weapon(attacker)

		if(ammo_clip[weapon] > 0 && weapon > 0)
		{
			refill_weapon(get_pdata_cbase(attacker, m_pActiveItem) , ammo_clip[weapon])
		}

		for(iId = WEAPON_CROWBAR; iId<=WEAPON_SNARK; iId++)
		{
			get_weaponname(iId, weapon_name, charsmax(weapon_name))
			Give_User_Weapon(attacker, weapon_name, iId)
		}

		fm_set_user_health(attacker, 100)
		fm_set_user_armor(attacker, 100)
	}
}

public primary_attack_tripmine(const ent)
{
	flNextPrimaryAttack(ent,0.08)
}

public primary_attack_snark(const ent)
{
	flNextPrimaryAttack(ent,0.08)
}

public primary_attack_hornetgun(const ent)
{
	flNextPrimaryAttack(ent,0.05)
}

stock flNextPrimaryAttack(const ent, const Float:fireRate)
{
	set_pdata_float(ent,m_flNextPrimaryAttack,fireRate,m_linuxoffset4)
}

public satchel_secondary_attack_post(const ent)
{
	flNextSecondaryAttack(ent,0.12)
}

public grenades_secondary_attack_post(const ent)
{
	flNextSecondaryAttack(ent,0.15)
}

public Grenade_Secondary_Attack_Post(const ent)
{
	flNextSecondaryAttack(ent,0.30)
}

stock flNextSecondaryAttack(const ent, const Float:fireRate)
{
	set_pdata_float(ent,m_flNextSecondaryAttack,fireRate,m_linuxoffset4)
}


public shotgun_primary_attack_post(const shotgun)
{
	new player = get_pdata_cbase(shotgun, m_pPlayer, m_linuxoffset4)

	if(old_clip[player] <= 0)
		return

	set_pdata_float(shotgun, m_flNextPrimaryAttack  , 0.40, m_linuxoffset4)

	if(get_pdata_int(shotgun, m_iClip, m_linuxoffset4) != 0)
		set_pdata_float(shotgun, m_flTimeWeaponIdle, 0.50, m_linuxoffset4)
	else
		set_pdata_float(shotgun, m_flTimeWeaponIdle, 0.50, m_linuxoffset4)
}

public primary_attack_pre(const ent)
{
	new player = get_pdata_cbase(ent, m_pPlayer, m_linuxoffset4)
	old_clip[player] = get_pdata_int(ent, m_iClip, m_linuxoffset4)
}

public glock_primary_attack_post(const glock)
{
	set_pdata_float(glock, m_flNextSecondaryAttack, 9999.0, 4)

	new player = get_pdata_cbase(glock, m_pPlayer, m_linuxoffset4)

	if(old_clip[player] <= 0)
		return

	set_pdata_float(glock, m_flNextPrimaryAttack  , 0.10, m_linuxoffset4)

	if(get_pdata_int(glock, m_iClip, m_linuxoffset4) != 0)
		set_pdata_float(glock, m_flTimeWeaponIdle, 2.0, m_linuxoffset4)
	else
		set_pdata_float(glock, m_flTimeWeaponIdle, 0.3, m_linuxoffset4)
}

public python_post(const python)
{
	set_pdata_float(python, m_flNextSecondaryAttack, 9999.0, 4)

	new player = get_pdata_cbase(python, m_pPlayer, m_linuxoffset4)

	if(old_clip[player] <= 0)
		return

	set_pdata_float(python, m_flNextPrimaryAttack  , 0.10, m_linuxoffset4)

	if(get_pdata_int(python, m_iClip, m_linuxoffset4) != 0)
		set_pdata_float(python, m_flTimeWeaponIdle, 2.0, m_linuxoffset4)
	else
		set_pdata_float(python, m_flTimeWeaponIdle, 0.3, m_linuxoffset4)
}

public python_rpga(const python)
{
	set_pdata_float(python, m_flNextSecondaryAttack, 9999.0, 4)

	new player = get_pdata_cbase(python, m_pPlayer, m_linuxoffset4)

	if(old_clip[player] <= 0)
		return

	set_pdata_float(python, m_flNextPrimaryAttack  , 0.10, m_linuxoffset4)

	if(get_pdata_int(python, m_iClip, m_linuxoffset4) != 0)
		set_pdata_float(python, m_flTimeWeaponIdle, 2.0, m_linuxoffset4)
	else
		set_pdata_float(python, m_flTimeWeaponIdle, 0.3, m_linuxoffset4)
}


public shotgun_secondary_attack_post(const shotgun)
{
	new player = get_pdata_cbase(shotgun, m_pPlayer, m_linuxoffset4)

	if(old_clip[player] <= 1)
		return

	set_pdata_float(shotgun, m_flNextSecondaryAttack, 0.60, m_linuxoffset4)

	if(get_pdata_int(shotgun, m_iClip, m_linuxoffset4) != 0)
		set_pdata_float(shotgun, m_flTimeWeaponIdle, 0.80, m_linuxoffset4)
	else
		set_pdata_float(shotgun, m_flTimeWeaponIdle, 0.80, m_linuxoffset4)
}

public shotgun_reload_pre(const shotgun)
{
	new player = get_pdata_cbase(shotgun, m_pPlayer, m_linuxoffset4)
	old_special_reload[player] = get_pdata_int(shotgun, m_fInSpecialReload, m_linuxoffset4)
}

public shotgun_reload_post(const shotgun)
{
	new player = get_pdata_cbase(shotgun, m_pPlayer, m_linuxoffset4)
	
	switch(old_special_reload[player])
	{
		case 0 :
		{
			if(get_pdata_int(shotgun, m_fInSpecialReload, m_linuxoffset4) == 1)
			{
				set_pdata_float(player , m_flNextAttack, 0.10)
				set_pdata_float(shotgun, m_flTimeWeaponIdle, 0.10, m_linuxoffset4)
				set_pdata_float(shotgun, m_flNextPrimaryAttack, 0.10, m_linuxoffset4)
				set_pdata_float(shotgun, m_flNextSecondaryAttack, 0.10, m_linuxoffset4)
			}
		}
		case 1 :
		{
			if(get_pdata_int(shotgun, m_fInSpecialReload, m_linuxoffset4) == 2)
			{
				set_pdata_float(shotgun, m_flTimeWeaponIdle, 0.10, m_linuxoffset4)
			}
		}
	}
}

public crossbow_primary_attack_post(const crossbow)
{
	set_pdata_float(crossbow, m_flNextPrimaryAttack, 0.30, m_linuxoffset4)
}

public crossbow_secondary_attack_post(const crossbow)
{
	set_pdata_float(crossbow, m_flNextSecondaryAttack, 0.25, m_linuxoffset4)
}

public crossbow_reload_post(const crossbow)
{
	new player = get_pdata_cbase(crossbow, m_pPlayer, m_linuxoffset4)
	
	set_pdata_float(player , m_flNextAttack, 0.10)
	set_pdata_float(crossbow, m_flTimeWeaponIdle, 0.10, m_linuxoffset4)
	set_pdata_float(crossbow, m_flNextPrimaryAttack, 0.10, m_linuxoffset4)
	set_pdata_float(crossbow, m_flNextSecondaryAttack, 0.10, m_linuxoffset4)
}

public crowbar_primary_attack_post(const firespeed)
{
	set_pdata_float(firespeed, m_flNextPrimaryAttack, 0.1, m_linuxoffset4)
}

public Forward_TraceAttack(const Victim, const Attacker, Float:Damage, const Float:Direction[3], const TraceResult, const Damagebits)
{
	if(is_player(Attacker) && (Damagebits & DMG_CROSSBOW) && get_user_weapon(Attacker) == HLW_CROSSBOW)
	{
		if(InZoom(Attacker))
		{
			SetHamParamFloat(3, 180.0)
			return HAM_HANDLED
		}
	}

	if(!(1 <= Attacker <= maxplayers))
		return HAM_IGNORED

	if(get_user_weapon(Attacker) == HLW_GLOCK)
		SetHamParamFloat(3, 60.0)

	if(get_user_weapon(Attacker) == HLW_PYTHON)
		SetHamParamFloat(3, 100.0)

	if(get_user_weapon(Attacker) == HLW_MP5)
		SetHamParamFloat(3, 50.0)

	return HAM_IGNORED
}

public TraceAttack(victim, inflictor, Float:damage, Float:direction[3], traceresult, damagebits)
{
	if(!(1 <= inflictor <= maxplayers))
		return HAM_IGNORED

	static weapon
	static Float:hitpoint[3]
	static Float:vector[3]
	static Float:bloodstart[3]

	weapon = get_user_weapon(inflictor)

	if(weapon == HLW_SHOTGUN)
	{
		SetHamParamFloat(3, 80.0)
		
		get_tr2(traceresult, TR_vecEndPos, hitpoint)

		xs_vec_mul_scalar(direction, random_float(100.0, 400.0), vector)
		xs_vec_mul_scalar(direction, 50.0, bloodstart)
		xs_vec_add(hitpoint, bloodstart, bloodstart)

		message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
		write_byte(TE_BLOODSTREAM)
		write_coord(floatround(bloodstart[0]))
		write_coord(floatround(bloodstart[1]))
		write_coord(floatround(bloodstart[2]))
		write_coord(floatround(vector[0])) // x
		write_coord(floatround(vector[1])) // y
		write_coord(floatround(vector[2])) //z
		write_byte(70) // color
		write_byte(150) // speed
		message_end()

		return HAM_IGNORED
	}		
	return HAM_IGNORED
}

public LongJump_Sound()
{
	BlockSound = register_forward(FM_EmitSound, "EmitSound_Block")
}

public EmitSound_Block()
{
	unregister_forward(FM_EmitSound, BlockSound)
	return FMRES_SUPERCEDE
}

public glock_secondary_attack(const entity)
{
	return HAM_SUPERCEDE
} 

public CmdStart(id, uc_handle, seed)
{
	if(glock[id] && get_uc(uc_handle, UC_Buttons) & IN_ATTACK2 && !(pev(id, pev_oldbuttons) & IN_ATTACK2))
	{
		switch(zoom[id])
		{
			case 0:
			{
				zoom[id] = 1
				set_pev(id, pev_fov, 45.0)
			}
			case 1:
			{
				zoom[id] = 0

				set_pev(id, pev_fov, fov)
			}
		}
		emit_sound(id, CHAN_ITEM, "weapons/xbow_reload1.wav", 0.20, 2.40, 0, 100)
	}
}

public item_holster(const gloc)
{
	new id = get_pdata_cbase(gloc, m_pPlayer, 4)

	set_pev(id, pev_fov, fov)

	glock[id] = false
}

public item_deploy(const gloc)
{
	set_pdata_float(gloc, m_flNextSecondaryAttack, 9999.0, 4)
	new id = get_pdata_cbase(gloc, m_pPlayer, 4)
	glock[id] = true
}

public glock_reload(const gloc)
{
	new id = get_pdata_cbase(gloc, m_pPlayer, 4)

	set_pev(id, pev_fov, fov)
}

public DeathMsg()					
{	
	static weapon[20]
	get_msg_arg_string(3, weapon, 19)

	if(equal(weapon, HLFW_CROWBAR)) 
		set_msg_arg_string(3, "crowbar")

	if(equal(weapon, HLFW_HANDGRENADE)) 
		set_msg_arg_string(3, "grenade")
}

public SecondaryAttack_Crowbar(ent)
{
	new id = get_pdata_cbase(ent, m_pPlayer, m_linuxoffset4)
	
	if(!crowbar_spawn(id))
	return HAM_IGNORED
	
	set_pdata_float(ent, m_flNextSecondaryAttack, 0.5, m_linuxoffset4)
	ExecuteHam(Ham_RemovePlayerItem, id, ent)
	user_has_weapon(id, HLW_CROWBAR, 0)
	ExecuteHamB(Ham_Item_Kill, ent)
	
	return HAM_IGNORED
}

public crowbar_spawn(id)
{
	new ent = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "info_target"))
	
	if(!pev_valid(ent))
		return 0
	
	set_pev(ent, pev_classname, HLFW_CROWBAR)
	engfunc(EngFunc_SetModel, ent, "models/w_crowbar.mdl")
	engfunc(EngFunc_SetSize, ent, Float:{-4.0, -4.0, -4.0} , Float:{4.0, 4.0, 4.0})
	
	get_projective_pos(id, vec)
	engfunc(EngFunc_SetOrigin, ent, vec)
	
	pev(id, pev_v_angle, vec)
	vec[0] = 90.0
	vec[2] = floatadd(vec[2], -90.0)
	
	set_pev(ent, pev_owner, id)
	set_pev(ent, pev_angles, vec)
	
	velocity_by_aim(id, 1500+get_speed(id), vec)
	set_pev(ent, pev_velocity, vec)
	
	set_pev(ent, pev_nextthink, get_gametime()+0.1)
	
	DispatchSpawn(ent)
	
	set_pev(ent, pev_movetype, MOVETYPE_TOSS)
	set_pev(ent, pev_solid, SOLID_BBOX)
	
	emit_sound(id, CHAN_WEAPON, "weapons/cbar_miss1.wav", 0.9, ATTN_NORM, 0, PITCH_NORM)
	set_task(0.1, "Fly_Whizz", ent)
	
	return ent
}

public hlfw_crowbar_touch(toucher, touched)
{
	pev(toucher, pev_origin, origin)
	pev(toucher, pev_angles, angles)
	
	if(!is_player(touched))
	{
		emit_sound(toucher, CHAN_WEAPON, "weapons/cbar_hit1.wav", 0.9, ATTN_NORM, 0, PITCH_NORM)
		
		engfunc(EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, origin, 0)
		write_byte(TE_SPARKS)
		engfunc(EngFunc_WriteCoord, origin[0])
		engfunc(EngFunc_WriteCoord, origin[1])
		engfunc(EngFunc_WriteCoord, origin[2])
		message_end()
	}
	else
	{
		ExecuteHamB(Ham_TakeDamage, touched, toucher, pev(toucher, pev_owner), 200, DMG_CLUB)	
		emit_sound(toucher, CHAN_WEAPON, "weapons/cbar_hitbod1.wav", 0.9, ATTN_NORM, 0, PITCH_NORM)
		
		engfunc(EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, origin, 0)
		write_byte(TE_BLOODSPRITE)
		engfunc(EngFunc_WriteCoord, origin[0]+random_num(-20, 20))
		engfunc(EngFunc_WriteCoord, origin[1]+random_num(-20, 20))
		engfunc(EngFunc_WriteCoord, origin[2]+random_num(-20, 20))
		write_short(blood_spray)
		write_short(blood_drop)
		write_byte(248)
		write_byte(15)
		message_end()
	}
	
	engfunc(EngFunc_RemoveEntity, toucher)
	
	new ent = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "weapon_crowbar"))
		
	DispatchSpawn(ent)
	set_pev(ent, pev_spawnflags, SF_NORESPAWN)	
	
	angles[0] = 0.0
	angles[2] = 0.0
	
	set_pev(ent, pev_origin, origin)
	set_pev(ent, pev_angles, angles)
}

public Weapon_think(ent)
{
	pev(ent, pev_angles, vec)
	vec[0] = floatadd(vec[0], -15.0)
	set_pev(ent, pev_angles, vec)
	
	set_pev(ent, pev_nextthink, get_gametime()+0.1)
}

public Fly_Whizz(ent)
{
	if(pev_valid(ent))
	{
		emit_sound(ent, CHAN_WEAPON, "weapons/cbar_miss1.wav", 0.9, ATTN_NORM, 0, PITCH_NORM)
		
		set_task(0.2, "Fly_Whizz", ent)
	}
}

get_projective_pos(player, Float:oridjin[3])
{
	GetGunPosition(player, oridjin)
	
	global_get(glb_v_forward, v_forward)
	global_get(glb_v_right, v_right)
	global_get(glb_v_up, v_up)
	
	xs_vec_mul_scalar(v_forward, 6.0, v_forward)
	xs_vec_mul_scalar(v_right, 2.0, v_right)
	xs_vec_mul_scalar(v_up, -2.0, v_up)
	
	xs_vec_add(oridjin, v_forward, oridjin)
	xs_vec_add(oridjin, v_right, oridjin)
	xs_vec_add(oridjin, v_up, oridjin)
}

stock GetGunPosition(const player, Float:origin[3])
{
	pev(player, pev_origin, origin)
	pev(player, pev_view_ofs, viewOfs)
	
	xs_vec_add(origin, viewOfs, origin)
}

public godmode(id) 
{
	if(!get_user_godmode(id)) 
	{
		set_user_godmode(id,true)
	}
	else 
	{
		set_user_godmode(id,false)
	}
}

public noclip(id) 
{
	if(!get_user_noclip(id)) 
	{
		set_user_noclip(id,true)
	}
	else 
	{
		set_user_noclip(id,false)
	}
}

public some_functions()
{
	static ent, i, map_name[10]
	
	while((ent = engfunc(EngFunc_FindEntityByString,ent,"classname","info_player_deathmatch")))
	{
		SpawnID[i++] = ent
		if(i == sizeof SpawnID)
		break
	}

	get_mapname(map_name, charsmax(map_name))
	
	if(equal(map_name,"crossfire"))
	{
		new eEnt = engfunc(EngFunc_FindEntityByString, eEnt, "targetname", "secret_door")

		set_pev(eEnt, pev_spawnflags, SPAWNFLAGS)
		set_pev(eEnt, pev_rendermode, kRenderTransColor)
		set_pev(eEnt, pev_rendercolor, Float:{0.0, 255.0, 0.0})
		set_pev(eEnt, pev_renderamt, 150.0)
	}

	while((ent = fm_find_ent_by_class(ent, "ammo_ARgrenades")))
	{
		if(pev_valid(ent))
		{
			engfunc(EngFunc_RemoveEntity, ent)
		}
	}
}

public Grenade_Secondary_Attack_Pre(weapon)
{
	static player, ammo, Float:origin[3], Float:velocity[3], Float:avelocity[3], Float:v_ofs[3], Float:angles[3], ent
	
	player = pev(weapon,pev_owner)

	ammo = get_pdata_int(player,GRENADE_AMMO,m_linuxoffset5)	
	
	if(ammo > 0)
		set_task(1.0,"HandGrenade_draw_anim",player + 4454)
	else
		return HAM_SUPERCEDE

	set_pdata_int(player,GRENADE_AMMO,ammo - 1,m_linuxoffset5)
	
	ent = engfunc(EngFunc_CreateNamedEntity,engfunc(EngFunc_AllocString,"grenade"))
	
	pev(player,pev_origin,origin)
	pev(player,pev_view_ofs,v_ofs)
	pev(player,pev_angles,angles)
	
	origin[0] += v_ofs[0] 
	origin[1] += v_ofs[1]
	origin[2] += v_ofs[2] 
	
	velocity_by_aim(player,800,velocity)	
	
	avelocity[0] = random_float(-500.0,100.0)
	avelocity[2] = random_float(-100.0,100.0)
	
	set_pev(ent,pev_avelocity,avelocity)	
	set_pev(ent,pev_origin,origin)
	set_pev(ent,pev_angles,angles)
	set_pev(ent,pev_owner,player)
	set_pev(ent,pev_gravity,0.5)
	set_pev(ent,pev_velocity,velocity)
	
	dllfunc(DLLFunc_Spawn,ent)
	
	set_pev(ent,pev_takedamage,DAMAGE_YES)
	set_pev(ent,pev_health,100.0)
	
	engfunc(EngFunc_SetModel,ent,"models/w_grenade.mdl")	
	
	UTIL_PlayWeaponAnimation(player,5)
	
	return HAM_HANDLED
}

public HandGrenade_draw_anim(player)
{
	player -= 4454
	if(get_user_weapon(player) == HLW_HANDGRENADE)
	UTIL_PlayWeaponAnimation(player,7)
}

public HandGrenade_Attack2_Touch(ent)
{
	ExecuteHam(Ham_TakeDamage,ent,0,0,1000.0,DMG_SHOCK)
}

stock UTIL_PlayWeaponAnimation(Player,Sequence)
{
	set_pev(Player,pev_weaponanim,Sequence)
	message_begin(MSG_ONE_UNRELIABLE,SVC_WEAPONANIM,.player = Player)
	write_byte(Sequence)
	write_byte(pev(Player,pev_body))
	message_end()
}

public TelePort(id)
{
	static spawnId, Float:origin[3], Float:angles[3], player, ent

	player = pev(id, pev_owner)
	ent = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "cycler_sprite"))

	set_pev(ent, pev_rendermode, kRenderTransAdd)
	engfunc(EngFunc_SetModel, ent, "sprites/b-tele1.spr")

	set_pev(ent, pev_renderamt, 255.0)
	set_pev(ent, pev_animtime, 1.0)
	set_pev(ent, pev_framerate, 50.0)
	set_pev(ent, pev_frame, 10)
	
	pev(player, pev_origin, origin)
	
	set_pev(ent,  pev_origin, origin)
	dllfunc(DLLFunc_Spawn, ent)
	set_pev(ent, pev_solid, SOLID_NOT)
	
	emit_sound(ent, CHAN_AUTO, "debris/beamstart4.wav", 0.8, ATTN_NORM, 0, PITCH_NORM)

	message_begin(MSG_BROADCAST,SVC_TEMPENTITY)
	write_byte(TE_DLIGHT)
	write_coord(floatround(origin[0]))
	write_coord(floatround(origin[1]))
	write_coord(floatround(origin[2]))
	write_byte(35)
	write_byte(80)
	write_byte(255)
	write_byte(100)
	write_byte(80)
	write_byte(60)
	message_end()
	
	spawnId = SpawnID[random_num(0,strlen(SpawnID) - 1)]
	
	pev(spawnId, pev_origin, origin)
	pev(spawnId, pev_angles, angles)
	
	set_pev(player, pev_origin, origin)
	set_pev(player, pev_angles, angles)
	set_pev(player, pev_fixangle, 1)
	set_pev(player, pev_velocity, {0.0, 0.0, 0.0})
	
	emit_sound(player, CHAN_AUTO, "debris/beamstart4.wav", 0.5, ATTN_NORM, 0, PITCH_NORM)
	
	message_begin(MSG_ONE, get_user_msgid("ScreenFade"), {0,0,0}, player)
	write_short(1<<10) 
	write_short(1<<3)
	write_short(0)
	write_byte(100)
	write_byte(255)
	write_byte(100)
	write_byte(150)
	message_end()	
	
	set_pdata_float(id,m_flNextSecondaryAttack,0.50,m_linuxoffset4)

	set_task(0.50, "remove_telesprite_task", ent + 33453)
}

public remove_telesprite_task(ent)
{
	ent -= 33453
	if(pev_valid(ent))
	engfunc(EngFunc_RemoveEntity, ent)
}

public plugin_precache()
{
	blood_drop = precache_model("sprites/blood.spr")
	blood_spray = precache_model("sprites/bloodspray.spr")
	precache_model("models/sphere.mdl")
	precache_sound("weapons/glauncher.wav")
	precache_sound("weapons/glauncher2.wav")
	precache_model("models/w_grenade.mdl")
	precache_sound("debris/beamstart4.wav")
	precache_model("sprites/b-tele1.spr")
}

Last edited by justafa.mustafa; 12-04-2019 at 12:50.
justafa.mustafa is offline
Old 11-26-2019, 05:05
Cyaveou
This message has been deleted by asherkin. Reason: Spam.
DJEarthQuake
Veteran Member
Join Date: Jan 2014
Location: Astral planes
Old 11-26-2019 , 07:35   Re: I'll pay for the job
Reply With Quote #2

I have had it working for weeks. We are playing with it at Tripmine studios. I've already explained the code taken from here https://forums.alliedmods.net/showpo...2&postcount=19 is what is making the crash once stripped down. Schlepping more broken plugins is supposed to fix it? I have the whole damn thing down to 1 line of code.

new iAll_Weapons = -2015363106;
__________________

Last edited by DJEarthQuake; 11-26-2019 at 08:00.
DJEarthQuake is offline
Old 12-09-2019, 05:02
Joalera
This message has been deleted by Joalera.
Dr Zayd
Senior Member
Join Date: Jun 2014
Location: forums.alliedmods.net
Old 12-17-2019 , 13:03   Re: I'll pay for the job
Reply With Quote #3

Clear logs, turn on the plugin, restart server and post your logs/error logs
__________________
Invisible System | 100%
ـــــــــــــــــــــــــــــ
Anti setinfo check | Ez Plugin and lite
ـــــــــــــــــــــــــــــ
[ZP] Free VIP Menu | Free VIP menu | ZP-Mod |
Dr Zayd is offline
^SmileY
Veteran Member
Join Date: Jan 2010
Location: Brazil [<o>]
Old 12-17-2019 , 13:30   Re: I'll pay for the job
Reply With Quote #4

This is duo a lot of constant offsets used.

Code:
const SPAWNFLAGS = 768
const WEAPON_CROWBAR = 1
const WEAPON_SNARK = 15
const m_linuxoffset5 = 5
const m_linuxoffset4 = 4
const m_maxitemtypes = 6
const m_pPlayer = 28
const m_pNext = 29
const m_iId = 30
const m_fInSpecialReload = 34
const m_flNextPrimaryAttack = 35
const m_flNextSecondaryAttack = 36
const m_flTimeWeaponIdle = 37
const m_iClip = 40
const m_iDefaultAmmo = 44
const m_flNextAttack = 148
const m_iFOV = 298
const m_rgpPlayerItems_Slot0 = 300
const m_pActiveItem = 306
const m_rgAmmo_Slot0 = 309
const GRENADE_AMMO = 319
I guess that is the main reason for crash, since HLDS have updated bro.
__________________
Projects:

- See my Git Hub: https://github.com/SmileYzn
PHP Code:
set_pcvar_num(pCvar, !get_pcvar_num(pCvar)); 
^SmileY is offline
Send a message via MSN to ^SmileY Send a message via Skype™ to ^SmileY
DJEarthQuake
Veteran Member
Join Date: Jan 2014
Location: Astral planes
Old 12-21-2019 , 08:01   Re: I'll pay for the job
Reply With Quote #5

The crowbar plugin took some searching and it's untested!!

Crowbar plugin was added onto your version of powerplay. I remade it from ground up on Github without the crowbar. Karma on the non-payment.









WINDOWS ONLY THIS ORIGINAL VERSION.
Attached Files
File Type: sma Get Plugin or Get Source (fly_crowbar.sma - 276 views - 6.5 KB)
__________________

Last edited by DJEarthQuake; 01-23-2024 at 15:46. Reason: Updated 07/2021
DJEarthQuake is offline
TigerMan
Junior Member
Join Date: Apr 2016
Old 02-11-2022 , 16:35   Re: I'll pay for the job
Reply With Quote #6

Quote:
Originally Posted by DJEarthQuake View Post
The crowbar plugin took some searching and it's untested!!

Crowbar plugin was added onto your version of powerplay. I remade it from ground up on Github without the crowbar. Karma on the non-payment.
server crashes with this plugin
TigerMan is offline
DJEarthQuake
Veteran Member
Join Date: Jan 2014
Location: Astral planes
Old 02-27-2022 , 07:01   Re: I'll pay for the job
Reply With Quote #7

I've never opened the crowbar plugin. Took some digging to find any copies.
__________________
DJEarthQuake is offline
DJEarthQuake
Veteran Member
Join Date: Jan 2014
Location: Astral planes
Old 01-23-2024 , 15:46   Re: I'll pay for the job
Reply With Quote #8

Finally tested Flying Crowbar plugin. It was written for Windows only and crashed Linux. I've updated it.
__________________

Last edited by DJEarthQuake; 01-23-2024 at 15:49.
DJEarthQuake is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 12:42.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode