Approved [CSO] Extra Item: Lycanthrope

Zombies/Humans Extra-Items
User avatar
Mohamed Alaa
Mod Developer
Mod Developer
Egypt
Posts: 664
Joined: 3 Years Ago
Location: Egypt
Has thanked: 38 times
Been thanked: 52 times
Age: 20
Contact:

[CSO] Extra Item: Lycanthrope

#1

Post by Mohamed Alaa » 3 Years Ago

Hi, my new gun is here.
It's from CSO (Counter-Strike Online), now it's for CS 1.6 with some new other features.

•Cvars:

Code: Select all

ze_scope_recoil 1.0	// Recoil
ze_scope_damage 6	// Damage
ze_scope_clip 30	// Clip
ze_scope_ammo 150	// Ammo
ze_scope_speed 4.5	// Speed (I advice to make it high because this is scope (sniper) so it'd be better
•••• I've added the dark knight model which is also in the video for if someone wanna use it.

• Suggestions are opened.
• Find bug & report so i could fix.

• Photos:

Image
Image
Image

• Video:
• Download:
  • Lycanthrope.zip
    [ZE] Extra-Item: Lycanthrope
    (2.29 MiB) Downloaded 369 times
    Lycanthrope.zip
    [ZE] Extra-Item: Lycanthrope
    (2.29 MiB) Downloaded 369 times
Have fun. :D
Last edited by Raheem on 28 Jul 2017, 13:26, edited 1 time in total.
Reason: Updating to work with Zombie Escape v1.1
Want your own mod edition? PM me.
Accepting web projects.
CS 1.6 hosting: powergamingtech.com

johnnysins2000
Veteran Member
Veteran Member
Pakistan
Posts: 672
Joined: 3 Years Ago
Location: Lahore
Has thanked: 11 times
Been thanked: 10 times
Age: 23
Contact:

#2

Post by johnnysins2000 » 3 Years Ago

:D I was Going to Share This With Sprites Effect I made after exams

Anyway Nice Bro
Nobody Is That Busy If They Make Time :roll:

SpartanMR
Member
Member
Venezuela
Posts: 1
Joined: 3 Years Ago
Has thanked: 0
Been thanked: 0
Contact:

#3

Post by SpartanMR » 3 Years Ago

Sorry, you can adapt it to zombie plague please...

johnnysins2000
Veteran Member
Veteran Member
Pakistan
Posts: 672
Joined: 3 Years Ago
Location: Lahore
Has thanked: 11 times
Been thanked: 10 times
Age: 23
Contact:

#4

Post by johnnysins2000 » 3 Years Ago

SpartanMR wrote:
3 Years Ago
Sorry, you can adapt it to zombie plague please...
I think what u mean to say is that u want this for zombie plague as well ?

Don't request about zp here ... if u want to request this thing for zp then directly pm us
Nobody Is That Busy If They Make Time :roll:

User avatar
sam_bhosale4
Mod Tester
Mod Tester
India
Posts: 109
Joined: 3 Years Ago
Location: INDIA
Has thanked: 5 times
Been thanked: 2 times
Age: 22
Contact:

#5

Post by sam_bhosale4 » 3 Years Ago

help me editing it.. i want this gun for vip only..
-=SeRious-GaminG|Zombie Escape[Alien vs. Predator]|Asia=-
206.189.132.169:40000
Image

johnnysins2000
Veteran Member
Veteran Member
Pakistan
Posts: 672
Joined: 3 Years Ago
Location: Lahore
Has thanked: 11 times
Been thanked: 10 times
Age: 23
Contact:

#6

Post by johnnysins2000 » 3 Years Ago

sam_bhosale4 wrote:
3 Years Ago
help me editing it.. i want this gun for vip only..
this zp lycanthrope ?
Nobody Is That Busy If They Make Time :roll:

johnnysins2000
Veteran Member
Veteran Member
Pakistan
Posts: 672
Joined: 3 Years Ago
Location: Lahore
Has thanked: 11 times
Been thanked: 10 times
Age: 23
Contact:

#7

Post by johnnysins2000 » 3 Years Ago

here bro converted with old method :/
untill raheem makes new method of making vip extra items then i will do that with that method ! ok ?

here is the code

Code: Select all

#include <zombie_escape>
#include <fakemeta_util>
#include <cstrike>

#define VIP_ACCESS ADMIN_LEVEL_H 

#define CSW_WEAPON_BASE CSW_P90	
#define CSW_NEW_WEAPON	"weapon_lycanthrope"
#define CSW_OLD_WEAPON	"weapon_p90"
#define WEAPON_KEY	9299292
#define OLD_WEAPON	"models/w_p90.mdl"
#define is_user_valid(%1) (is_user_alive(%1) && !is_user_bot(%1) && !is_user_hltv(%1) && is_user_connected(%1))

new const Weapon_Models[][] = { "models/v_lycanthrope2.mdl", "models/p_lycanthrope.mdl", "models/w_lycanthrope.mdl" }
new const Weapon_Sounds[][] = { "weapons/sg552-1.wav", "weapons/sg552-2.wav", "weapons/buffsg552_draw.wav", "weapons/buffsg552_idle.wav", "weapons/buffsg552_reload.wav", "weapons/buffsg552_reload_AF.wav" }
new const Weapon_Sprites[][] = { "sprites/weapon_lycanthrope.txt", "sprites/640hud148.spr" }
new const GUNSHOT_DECALS[] = { 41, 42, 43, 44, 45 }

new scope, bool:g_Hasscope[33], g_hasZoom[33]
new Cvar_scope_Recoil, Cvar_scope_DMG, Cvar_scope_Clip, Cvar_scope_Ammo, Cvar_scope_Speed
new Float:cl_pushangle[33][3], g_Eventscope, g_scope_TmpClip[33], g_IsInPrimaryAttack, g_Shock

public plugin_precache()
{
	for(new g = 0; g < sizeof(Weapon_Models); g++)
		precache_model(Weapon_Models[g])
	for(new h = 0; h < sizeof(Weapon_Sounds); h++)
		precache_sound(Weapon_Sounds[h])
	for(new t = 0; t < sizeof(Weapon_Sprites); t++)
		precache_generic(Weapon_Sprites[t])
		
	g_Shock = precache_model("sprites/lycanthrope_hit.spr")
		
	register_clcmd(CSW_NEW_WEAPON, "hook")
	register_forward(FM_PrecacheEvent, "Fw_Precache_Event", 1)
}

public hook(id)
{
	engclient_cmd(id, CSW_OLD_WEAPON)
	return PLUGIN_HANDLED
}

public plugin_init()
{
	register_plugin("[ZE] Extra Item: Lycanthrope", "1.0", "JaCk GamePlay")
	scope = ze_register_item("Lycanthrope", 1)
	
	// Events & Messages
	register_message(get_user_msgid("DeathMsg"), "DeathMsg")
	register_event("CurWeapon", "CurrentWeapon", "be", "1=1")
	register_event("HLTV", "New_Round", "a", "1=0", "2=0")
	
	// Forwards
	register_forward(FM_SetModel, "Fw_Set_Model", 1)
	register_forward(FM_PlaybackEvent, "Fw_Playback_Event")
	register_forward(FM_UpdateClientData, "Fw_Update_Clientdata", 1)
	register_forward(FM_CmdStart, "Fw_CmdStart")
	
	// Hook Chains
	RegisterHookChain(RG_CBasePlayer_TakeDamage, "Fw_Take_DMG")
	// Hams
	RegisterHam(Ham_Weapon_PrimaryAttack, CSW_OLD_WEAPON, "Fw_PrimaryAttack")
	RegisterHam(Ham_Weapon_PrimaryAttack, CSW_OLD_WEAPON, "Fw_PrimaryAttack_Post", 1)
	RegisterHam(Ham_Item_AddToPlayer, CSW_OLD_WEAPON, "Fw_AddToPlayer")
	RegisterHam(Ham_Weapon_Reload, CSW_OLD_WEAPON, "Fw_Reload")
	RegisterHam(Ham_Weapon_Reload, CSW_OLD_WEAPON, "Fw_Reload_Post", 1)
	RegisterHam(Ham_Spawn, "player", "Fw_Spawn", 1)
	RegisterHam(Ham_TraceAttack, "worldspawn", "Fw_TraceAttack", 1)
	RegisterHam(Ham_TraceAttack, "func_breakable", "Fw_TraceAttack", 1)
	RegisterHam(Ham_TraceAttack, "func_wall", "Fw_TraceAttack", 1)
	RegisterHam(Ham_TraceAttack, "func_door", "Fw_TraceAttack", 1)
	RegisterHam(Ham_TraceAttack, "func_door_rotating", "Fw_TraceAttack", 1)
	RegisterHam(Ham_TraceAttack, "func_plat", "Fw_TraceAttack", 1)
	RegisterHam(Ham_TraceAttack, "func_rotating", "Fw_TraceAttack", 1)
	RegisterHam(Ham_Use, "func_tank", "Fw_UseStationary_Post", 1)
	RegisterHam(Ham_Use, "func_tankmortar", "Fw_UseStationary_Post", 1)
	RegisterHam(Ham_Use, "func_tankrocket", "Fw_UseStationary_Post", 1)
	RegisterHam(Ham_Use, "func_tanklaser", "Fw_UseStationary_Post", 1)
	RegisterHam(Ham_Item_Deploy, CSW_OLD_WEAPON, "Fw_Item_Deploy_Post", 1)
	
	// Cvars
	Cvar_scope_Recoil = register_cvar("ze_scope_recoil", "1.0")
	Cvar_scope_DMG = register_cvar("ze_scope_damage", "6")
	Cvar_scope_Clip = register_cvar("ze_scope_clip", "30")
	Cvar_scope_Ammo = register_cvar("ze_scope_ammo", "150")
	Cvar_scope_Speed = register_cvar("ze_scope_speed", "4.5")
}

public Fw_Item_Deploy_Post(weapon_ent)
{
	new id = get_pdata_cbase(weapon_ent, 41, 4)
	g_hasZoom[id] = false
	cs_set_user_zoom(id, CS_RESET_ZOOM, 0)
	CurrentWeapon(id)
}

public Fw_UseStationary_Post(entity, caller, activator, use_type)
{
	if (use_type == 0 && is_user_valid(caller))
	{
		CurrentWeapon(caller)
	}
}

public Fw_TraceAttack(iEnt, iAttacker, Float:flDamage, Float:fDir[3], ptr, iDamageType)
{
	if(!is_user_valid(iAttacker))
		return
	
	static Float:flEnd[3]
	get_tr2(ptr, TR_vecEndPos, flEnd)
	
	if(get_user_weapon(iAttacker) == CSW_WEAPON_BASE && g_Hasscope[iAttacker])
	{
		if(iEnt)
		{
			message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
			write_byte(TE_DECAL)
			engfunc(EngFunc_WriteCoord, flEnd[0])
			engfunc(EngFunc_WriteCoord, flEnd[1])
			engfunc(EngFunc_WriteCoord, flEnd[2])
			write_byte(GUNSHOT_DECALS[random_num (0, sizeof GUNSHOT_DECALS -1)])
			write_short(iEnt)
			message_end()
		}
		else
		{
			message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
			write_byte(TE_WORLDDECAL)
			engfunc(EngFunc_WriteCoord, flEnd[0])
			engfunc(EngFunc_WriteCoord, flEnd[1])
			engfunc(EngFunc_WriteCoord, flEnd[2])
			write_byte(GUNSHOT_DECALS[random_num (0, sizeof GUNSHOT_DECALS -1)])
			message_end()
		}
		message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
		write_byte(TE_GUNSHOTDECAL)
		engfunc(EngFunc_WriteCoord, flEnd[0])
		engfunc(EngFunc_WriteCoord, flEnd[1])
		engfunc(EngFunc_WriteCoord, flEnd[2])
		write_short(iAttacker)
		write_byte(GUNSHOT_DECALS[random_num (0, sizeof GUNSHOT_DECALS -1)])
		message_end()
		
		engfunc(EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, flEnd, 0)
		write_byte(TE_SPRITE)
		engfunc(EngFunc_WriteCoord,flEnd[0])
		engfunc(EngFunc_WriteCoord,flEnd[1])
		engfunc(EngFunc_WriteCoord,flEnd[2])
		write_short(g_Shock)
		write_byte(5)
		write_byte(150)
		message_end()
	}
}

public Fw_Spawn(id)
{
	if(!is_user_valid(id))
		return
		
	Remove_scope(id)
}

public New_Round()
{
	for(new i = 0; i < get_member_game(m_nMaxPlayers); i++)
	{
		if(!is_user_valid(i) || !g_Hasscope[i])
			continue
			
		Remove_scope(i)
	}
}

public Fw_Reload_Post(weapon_entity) 
{
	new id = pev(weapon_entity, pev_owner)
	if (!is_user_valid(id) || ze_is_user_zombie(id) || g_scope_TmpClip[id] == -1)
		return HAM_IGNORED
		
	if(g_Hasscope[id])
	{
		g_hasZoom[id] = false
		cs_set_user_zoom(id, CS_RESET_ZOOM, 0)
		set_pdata_int(weapon_entity, 51, g_scope_TmpClip[id], 4)
		set_pdata_float(weapon_entity, 48, 3.0, 4)
		set_pdata_float(id, 83, 3.0, 5)
		set_pdata_int(weapon_entity, 54, 1, 4)
		UTIL_weapon_anim(id, weapon_entity, 1)
	}
	return HAM_IGNORED
}

public Fw_Reload(weapon_entity) 
{
	new id = pev(weapon_entity, pev_owner)
	if (!is_user_valid(id) || ze_is_user_zombie(id))
		return HAM_IGNORED

	static iClipExtra
	if(g_Hasscope[id])
	{
		iClipExtra = get_pcvar_num(Cvar_scope_Clip)
	}

	g_scope_TmpClip[id] = -1
	
	new iBpAmmo = cs_get_user_bpammo(id, CSW_WEAPON_BASE)
	new iClip = get_pdata_int(weapon_entity, 51, 4)

	if (iBpAmmo <= 0 || iClip >= iClipExtra)
		return HAM_SUPERCEDE
		
	g_scope_TmpClip[id] = iClip

	return HAM_IGNORED
}

public Fw_AddToPlayer(ent, id)
{
	if(!is_valid_ent(ent) || !is_user_valid(id) || ze_is_user_zombie(id))
		return HAM_IGNORED
	
	if(entity_get_int(ent, EV_INT_impulse) == WEAPON_KEY)
	{
		g_Hasscope[id] = true
		g_hasZoom[id] = false
		cs_set_user_zoom(id, CS_RESET_ZOOM, 0)
		entity_set_int(ent, EV_INT_impulse, 0)
		
		message_begin(MSG_ONE, get_user_msgid("WeaponList"), {0, 0, 0}, id)
		write_string(CSW_NEW_WEAPON)
		write_byte(7)
		write_byte(100)
		write_byte(-1)
		write_byte(-1)
		write_byte(0)
		write_byte(8)
		write_byte(CSW_WEAPON_BASE)
		write_byte(0)
		message_end()
		return HAM_HANDLED
	}
	else
	{
		message_begin(MSG_ONE, get_user_msgid("WeaponList"), {0, 0, 0}, id)
		write_string(CSW_OLD_WEAPON)
		write_byte(7)
		write_byte(100)
		write_byte(-1)
		write_byte(-1)
		write_byte(0)
		write_byte(8)
		write_byte(CSW_WEAPON_BASE)
		write_byte(0)
		message_end()
	}
	return HAM_IGNORED
}

public Fw_Precache_Event(type, const name[])
{
	if(equal("events/p90.sc", name))
	{
		g_Eventscope = get_orig_retval()
	}
}

public Fw_Update_Clientdata(id, sendweapons, cd_handle)
{
	if(!is_user_valid(id))
		return

	if(get_user_weapon(id) == CSW_WEAPON_BASE && g_Hasscope[id])
	{
		set_cd(cd_handle, CD_flNextAttack, halflife_time() + 0.001)
	}
}

public Fw_Playback_Event(flags, invoker, eventid, Float:delay, Float:origin[3], Float:angles[3], Float:fparam1, Float:fparam2, iParam1, iParam2, bParam1, bParam2)
{
	if(!is_user_valid(invoker) || !g_IsInPrimaryAttack)
		return
    
	if(eventid == g_Eventscope && get_user_weapon(invoker) == CSW_WEAPON_BASE && g_Hasscope[invoker])
	{
		engfunc(EngFunc_PlaybackEvent, flags | FEV_HOSTONLY, invoker, eventid, delay, origin, angles, fparam1, fparam2, iParam1, iParam2, bParam1, bParam2)
		UTIL_weapon_anim(invoker, eventid, random_num(3, 5))
		emit_sound(invoker, CHAN_WEAPON, Weapon_Sounds[random_num(0, 1)], VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
	}
}

public ze_user_humanized(id)
{
	if(!is_user_valid(id))
		return
		
	Remove_scope(id)
}

public ze_user_infected(id, infector)
{
	if(!is_user_valid(id) || !is_user_valid(infector))
		return
		
	Remove_scope(id)
}

public Fw_PrimaryAttack(Weapon)
{
	g_IsInPrimaryAttack = 0
	
	new szClip, szAmmo, id
	id = get_pdata_cbase(Weapon, 41, 4)
	get_user_weapon(id, szClip, szAmmo)
	if(!is_user_valid(id) || ze_is_user_zombie(id))
		return

	g_IsInPrimaryAttack = 1
	if(g_Hasscope[id])
	{
		if (!cs_get_weapon_ammo(Weapon))
			return

		new Float:push[3]
		pev(id, pev_punchangle, push)
		xs_vec_sub(push, cl_pushangle[id], push)
		xs_vec_mul_scalar(push, get_pcvar_float(Cvar_scope_Recoil), push)
		xs_vec_add(push, cl_pushangle[id], push)
		set_pev(id, pev_punchangle, push)
		UTIL_weapon_anim(id, Weapon, random_num(3, 5))
		emit_sound(id, CHAN_WEAPON, Weapon_Sounds[random_num(0, 1)], VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
	}
}

public Fw_CmdStart(id, handle)
{
	if(!is_user_valid(id) || ze_is_user_zombie(id))
		return
		
	if((get_uc(handle, UC_Buttons) & IN_ATTACK2) && !(pev(id, pev_oldbuttons) & IN_ATTACK2))
	{
		if(get_user_weapon(id) == CSW_WEAPON_BASE && g_Hasscope[id] && !g_hasZoom[id])
		{
			g_hasZoom[id] = true
			cs_set_user_zoom(id, CS_SET_FIRST_ZOOM, 0)
		}
		else if(get_user_weapon(id) == CSW_WEAPON_BASE && g_Hasscope[id] && g_hasZoom[id])
		{
			g_hasZoom[id] = false
			cs_set_user_zoom(id, CS_RESET_ZOOM, 0)
		}
	}
}

public Fw_Take_DMG(Victim, Inflictor, Attacker, Float:Damage, DamageType)
{
	if(!is_user_valid(Victim) || !is_user_valid(Attacker) ||ze_is_user_zombie(Attacker))
		return
	
	if(get_user_weapon(Attacker) == CSW_WEAPON_BASE && g_Hasscope[Attacker])
	{
		SetHamParamFloat(4, Damage * get_pcvar_float(Cvar_scope_DMG))
	}
}

public Fw_PrimaryAttack_Post(Weapon)
{
	g_IsInPrimaryAttack = 0
	new szClip, szAmmo, id
	id = get_pdata_cbase(Weapon, 41, 4)
	get_user_weapon(id, szClip, szAmmo)
	
	if(!is_user_valid(id) || ze_is_user_zombie(id))
		return

	if(g_Hasscope[id])
	{
		if (!cs_get_weapon_ammo(Weapon))
			return

		new Float:push[3]
		pev(id, pev_punchangle, push)
		xs_vec_sub(push, cl_pushangle[id], push)
		xs_vec_mul_scalar(push, get_pcvar_float(Cvar_scope_Recoil), push)
		xs_vec_add(push, cl_pushangle[id], push)
		set_pev(id, pev_punchangle, push)
		UTIL_weapon_anim(id, Weapon, random_num(3, 5))
		emit_sound(id, CHAN_WEAPON, Weapon_Sounds[random_num(0, 1)], VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
	}
}

public Fw_Set_Model(entity, model[])
{
	if(!pev_valid(entity) || !equal(model, OLD_WEAPON))
		return FMRES_IGNORED
	
	static szClassName[33], id
	id = pev(entity, pev_owner)
	pev(entity, pev_classname, szClassName, charsmax(szClassName))
	if(!equal(szClassName, "weaponbox"))
		return FMRES_IGNORED
	
	if(g_Hasscope[id] && pev_valid(fm_find_ent_by_owner(-1, CSW_OLD_WEAPON, entity)))
	{
		g_Hasscope[id] = false
		g_hasZoom[id] = false
		cs_set_user_zoom(id, CS_RESET_ZOOM, 0)
		set_pev(fm_find_ent_by_owner(-1, CSW_OLD_WEAPON, entity), pev_impulse, WEAPON_KEY)
		engfunc(EngFunc_SetModel, entity, Weapon_Models[2])
		return FMRES_SUPERCEDE
	}
	return FMRES_IGNORED
}

public CurrentWeapon(id)
{
	if(!is_user_valid(id))
		return
		
	if(get_user_weapon(id) == CSW_WEAPON_BASE && g_Hasscope[id])
	{
		if(g_hasZoom[id])
		{
			cs_set_player_view_model(id, CSW_WEAPON_BASE, "")
		}
		else if(!g_hasZoom[id])
		{
			cs_set_player_view_model(id, CSW_WEAPON_BASE, Weapon_Models[0])
		}
		cs_set_player_weap_model(id, CSW_WEAPON_BASE, Weapon_Models[1])
		
		message_begin(MSG_ONE, get_user_msgid("WeaponList"), {0, 0, 0}, id)
		write_string(CSW_NEW_WEAPON)
		write_byte(7)
		write_byte(100)
		write_byte(-1)
		write_byte(-1)
		write_byte(0)
		write_byte(8)
		write_byte(CSW_WEAPON_BASE)
		write_byte(0)
		message_end()
		
		static Float:iSpeed; iSpeed = get_pcvar_float(Cvar_scope_Speed)
		static Ent; Ent = find_ent_by_owner(-1, CSW_OLD_WEAPON, id)
		if(Ent)
		{
			static Float:Delay; Delay = get_pdata_float( Ent, 46, 4) * iSpeed
			if (Delay > 0.0)
			{
				set_pdata_float(Ent, 46, Delay, 4)
			}
		}
	}
}

public DeathMsg(msg_id, msg_dest, id)
{
	static szTruncatedWeapon[33], iAttacker, iVictim
	get_msg_arg_string(4, szTruncatedWeapon, charsmax(szTruncatedWeapon))
	
	iAttacker = get_msg_arg_int(1)
	iVictim = get_msg_arg_int(2)
	
	if(!is_user_valid(iAttacker) || iAttacker == iVictim)	return
	
	if(equal(szTruncatedWeapon, "p90") && get_user_weapon(iAttacker) == CSW_WEAPON_BASE && g_Hasscope[iAttacker])
	{
		set_msg_arg_string(4, "lycanthrope")
	}
}

public ze_select_item_pre(id, itemid)
{
    // This not our item?
    if (itemid != scope)
        return ZE_ITEM_AVAILABLE
   
    // Available for Humans only, So don't show it for zombies
    if (ze_is_user_zombie(id))
        return ZE_ITEM_DONT_SHOW
   
    // Player Not VIP?
    if (!(get_user_flags(id) & VIP_ACCESS)) 
        return ZE_ITEM_DONT_SHOW
   
    // Finally return that it's available
    return ZE_ITEM_AVAILABLE
}

public ze_select_item_post(id, itemid)
{
	if(itemid != scope)
		return
		
	Givescope(id)
}

public Givescope(id)
{
	drop_weapons(id, 1)
	new wep = give_item(id, CSW_OLD_WEAPON)
	if (wep > 0)
	{
		cs_set_weapon_ammo(wep, get_pcvar_num(Cvar_scope_Clip))
		cs_set_user_bpammo(id, CSW_WEAPON_BASE, get_pcvar_num(Cvar_scope_Ammo))
		
		message_begin(MSG_ONE, get_user_msgid("WeaponList"), {0, 0, 0}, id)
		write_string(CSW_NEW_WEAPON)
		write_byte(7)
		write_byte(100)
		write_byte(-1)
		write_byte(-1)
		write_byte(0)
		write_byte(8)
		write_byte(CSW_WEAPON_BASE)
		write_byte(0)
		message_end()
	}
	g_Hasscope[id] = true
	g_hasZoom[id] = false
	cs_set_user_zoom(id, CS_RESET_ZOOM, 0)
	UTIL_weapon_anim(id, CSW_WEAPON_BASE, 2)
	ze_colored_print(id, "You bought Lycanthrope.")
}

public Remove_scope(id)
{
	if(!is_user_valid(id))
		return
		
	g_Hasscope[id] = false
	g_hasZoom[id] = false
	cs_set_user_zoom(id, CS_SET_NO_ZOOM, 0)
	message_begin(MSG_ONE, get_user_msgid("WeaponList"), {0, 0, 0}, id)
	write_string(CSW_OLD_WEAPON)
	write_byte(7)
	write_byte(100)
	write_byte(-1)
	write_byte(-1)
	write_byte(0)
	write_byte(8)
	write_byte(CSW_WEAPON_BASE)
	write_byte(0)
	message_end()
	cs_reset_player_view_model(id, CSW_WEAPON_BASE)
	cs_reset_player_weap_model(id, CSW_WEAPON_BASE)
}

UTIL_weapon_anim(index, entity, sequence = 0)
{
	set_pev(index, pev_weaponanim, sequence)

	message_begin(MSG_ONE_UNRELIABLE, SVC_WEAPONANIM, {0, 0, 0}, index)
	write_byte(sequence)
	write_byte(pev(entity, pev_body))
	message_end()
}

stock drop_weapons(id, dropwhat)
{
	static weapons[32], num, i, weaponid
	num = 0
	get_user_weapons(id, weapons, num)
	
	const PRIMARY_WEAPONS_BIT_SUM = (1<<CSW_SCOUT)|(1<<CSW_XM1014)|(1<<CSW_MAC10)|(1<<CSW_MAC10)|(1<<CSW_UMP45)|(1<<CSW_SG550)|(1<<CSW_MAC10)|(1<<CSW_FAMAS)|(1<<CSW_AWP)|(1<<CSW_MP5NAVY)|(1<<CSW_M249)|(1<<CSW_M3)|(1<<CSW_M4A1)|(1<<CSW_TMP)|(1<<CSW_G3SG1)|(1<<CSW_SG552)|(1<<CSW_AK47)|(1<<CSW_P90)
	
	for (i = 0; i < num; i++)
	{
		weaponid = weapons[i]
		
		if (dropwhat == 1 && ((1<<weaponid) & PRIMARY_WEAPONS_BIT_SUM))
		{
			static wname[32]
			get_weaponname(weaponid, wname, charsmax(wname))
			engclient_cmd(id, "drop", wname)
		}
	}
}
Nobody Is That Busy If They Make Time :roll:

User avatar
Mohamed Alaa
Mod Developer
Mod Developer
Egypt
Posts: 664
Joined: 3 Years Ago
Location: Egypt
Has thanked: 38 times
Been thanked: 52 times
Age: 20
Contact:

#8

Post by Mohamed Alaa » 3 Years Ago

With last VIP update.

Code: Select all

#include <ze_vip>
#include <fakemeta_util>
#include <cstrike>

#define VIP_ACCESS VIP_A 

#define CSW_WEAPON_BASE CSW_P90	
#define CSW_NEW_WEAPON	"weapon_lycanthrope"
#define CSW_OLD_WEAPON	"weapon_p90"
#define WEAPON_KEY	9299292
#define OLD_WEAPON	"models/w_p90.mdl"
#define is_user_valid(%1) (is_user_alive(%1) && !is_user_bot(%1) && !is_user_hltv(%1) && is_user_connected(%1))

new const Weapon_Models[][] = { "models/v_lycanthrope2.mdl", "models/p_lycanthrope.mdl", "models/w_lycanthrope.mdl" }
new const Weapon_Sounds[][] = { "weapons/sg552-1.wav", "weapons/sg552-2.wav", "weapons/buffsg552_draw.wav", "weapons/buffsg552_idle.wav", "weapons/buffsg552_reload.wav", "weapons/buffsg552_reload_AF.wav" }
new const Weapon_Sprites[][] = { "sprites/weapon_lycanthrope.txt", "sprites/640hud148.spr" }
new const GUNSHOT_DECALS[] = { 41, 42, 43, 44, 45 }

new scope, bool:g_Hasscope[33], g_hasZoom[33]
new Cvar_scope_Recoil, Cvar_scope_DMG, Cvar_scope_Clip, Cvar_scope_Ammo, Cvar_scope_Speed
new Float:cl_pushangle[33][3], g_Eventscope, g_scope_TmpClip[33], g_IsInPrimaryAttack, g_Shock

public plugin_precache()
{
	for(new g = 0; g < sizeof(Weapon_Models); g++)
		precache_model(Weapon_Models[g])
	for(new h = 0; h < sizeof(Weapon_Sounds); h++)
		precache_sound(Weapon_Sounds[h])
	for(new t = 0; t < sizeof(Weapon_Sprites); t++)
		precache_generic(Weapon_Sprites[t])
		
	g_Shock = precache_model("sprites/lycanthrope_hit.spr")
		
	register_clcmd(CSW_NEW_WEAPON, "hook")
	register_forward(FM_PrecacheEvent, "Fw_Precache_Event", 1)
}

public hook(id)
{
	engclient_cmd(id, CSW_OLD_WEAPON)
	return PLUGIN_HANDLED
}

public plugin_init()
{
	register_plugin("[ZE] Extra Item: Lycanthrope", "1.0", "Jack GamePlay")
	scope = ze_register_item("Lycanthrope", 1)
	
	// Events & Messages
	register_message(get_user_msgid("DeathMsg"), "DeathMsg")
	register_event("CurWeapon", "CurrentWeapon", "be", "1=1")
	register_event("HLTV", "New_Round", "a", "1=0", "2=0")
	
	// Forwards
	register_forward(FM_SetModel, "Fw_Set_Model", 1)
	register_forward(FM_PlaybackEvent, "Fw_Playback_Event")
	register_forward(FM_UpdateClientData, "Fw_Update_Clientdata", 1)
	register_forward(FM_CmdStart, "Fw_CmdStart")
	
	// Hook Chains
	RegisterHookChain(RG_CBasePlayer_TakeDamage, "Fw_Take_DMG")
	// Hams
	RegisterHam(Ham_Weapon_PrimaryAttack, CSW_OLD_WEAPON, "Fw_PrimaryAttack")
	RegisterHam(Ham_Weapon_PrimaryAttack, CSW_OLD_WEAPON, "Fw_PrimaryAttack_Post", 1)
	RegisterHam(Ham_Item_AddToPlayer, CSW_OLD_WEAPON, "Fw_AddToPlayer")
	RegisterHam(Ham_Weapon_Reload, CSW_OLD_WEAPON, "Fw_Reload")
	RegisterHam(Ham_Weapon_Reload, CSW_OLD_WEAPON, "Fw_Reload_Post", 1)
	RegisterHam(Ham_Spawn, "player", "Fw_Spawn", 1)
	RegisterHam(Ham_TraceAttack, "worldspawn", "Fw_TraceAttack", 1)
	RegisterHam(Ham_TraceAttack, "func_breakable", "Fw_TraceAttack", 1)
	RegisterHam(Ham_TraceAttack, "func_wall", "Fw_TraceAttack", 1)
	RegisterHam(Ham_TraceAttack, "func_door", "Fw_TraceAttack", 1)
	RegisterHam(Ham_TraceAttack, "func_door_rotating", "Fw_TraceAttack", 1)
	RegisterHam(Ham_TraceAttack, "func_plat", "Fw_TraceAttack", 1)
	RegisterHam(Ham_TraceAttack, "func_rotating", "Fw_TraceAttack", 1)
	RegisterHam(Ham_Use, "func_tank", "Fw_UseStationary_Post", 1)
	RegisterHam(Ham_Use, "func_tankmortar", "Fw_UseStationary_Post", 1)
	RegisterHam(Ham_Use, "func_tankrocket", "Fw_UseStationary_Post", 1)
	RegisterHam(Ham_Use, "func_tanklaser", "Fw_UseStationary_Post", 1)
	RegisterHam(Ham_Item_Deploy, CSW_OLD_WEAPON, "Fw_Item_Deploy_Post", 1)
	
	// Cvars
	Cvar_scope_Recoil = register_cvar("ze_scope_recoil", "1.0")
	Cvar_scope_DMG = register_cvar("ze_scope_damage", "6")
	Cvar_scope_Clip = register_cvar("ze_scope_clip", "30")
	Cvar_scope_Ammo = register_cvar("ze_scope_ammo", "150")
	Cvar_scope_Speed = register_cvar("ze_scope_speed", "4.5")
}

public Fw_Item_Deploy_Post(weapon_ent)
{
	new id = get_pdata_cbase(weapon_ent, 41, 4)
	g_hasZoom[id] = false
	cs_set_user_zoom(id, CS_RESET_ZOOM, 0)
	CurrentWeapon(id)
}

public Fw_UseStationary_Post(entity, caller, activator, use_type)
{
	if (use_type == 0 && is_user_valid(caller))
	{
		CurrentWeapon(caller)
	}
}

public Fw_TraceAttack(iEnt, iAttacker, Float:flDamage, Float:fDir[3], ptr, iDamageType)
{
	if(!is_user_valid(iAttacker))
		return
	
	static Float:flEnd[3]
	get_tr2(ptr, TR_vecEndPos, flEnd)
	
	if(get_user_weapon(iAttacker) == CSW_WEAPON_BASE && g_Hasscope[iAttacker])
	{
		if(iEnt)
		{
			message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
			write_byte(TE_DECAL)
			engfunc(EngFunc_WriteCoord, flEnd[0])
			engfunc(EngFunc_WriteCoord, flEnd[1])
			engfunc(EngFunc_WriteCoord, flEnd[2])
			write_byte(GUNSHOT_DECALS[random_num (0, sizeof GUNSHOT_DECALS -1)])
			write_short(iEnt)
			message_end()
		}
		else
		{
			message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
			write_byte(TE_WORLDDECAL)
			engfunc(EngFunc_WriteCoord, flEnd[0])
			engfunc(EngFunc_WriteCoord, flEnd[1])
			engfunc(EngFunc_WriteCoord, flEnd[2])
			write_byte(GUNSHOT_DECALS[random_num (0, sizeof GUNSHOT_DECALS -1)])
			message_end()
		}
		message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
		write_byte(TE_GUNSHOTDECAL)
		engfunc(EngFunc_WriteCoord, flEnd[0])
		engfunc(EngFunc_WriteCoord, flEnd[1])
		engfunc(EngFunc_WriteCoord, flEnd[2])
		write_short(iAttacker)
		write_byte(GUNSHOT_DECALS[random_num (0, sizeof GUNSHOT_DECALS -1)])
		message_end()
		
		engfunc(EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, flEnd, 0)
		write_byte(TE_SPRITE)
		engfunc(EngFunc_WriteCoord, flEnd[0])
		engfunc(EngFunc_WriteCoord, flEnd[1])
		engfunc(EngFunc_WriteCoord, flEnd[2])
		write_short(g_Shock)
		write_byte(5)
		write_byte(150)
		message_end()
	}
}

public Fw_Spawn(id)
{
	if(!is_user_valid(id))
		return
		
	Remove_scope(id)
}

public New_Round()
{
	for(new i = 0; i < get_member_game(m_nMaxPlayers); i++)
	{
		if(!is_user_valid(i) || !g_Hasscope[i])
			continue
			
		Remove_scope(i)
	}
}

public Fw_Reload_Post(weapon_entity) 
{
	new id = pev(weapon_entity, pev_owner)
	if (!is_user_valid(id) || ze_is_user_zombie(id) || g_scope_TmpClip[id] == -1)
		return HAM_IGNORED
		
	if(g_Hasscope[id])
	{
		g_hasZoom[id] = false
		cs_set_user_zoom(id, CS_RESET_ZOOM, 0)
		set_pdata_int(weapon_entity, 51, g_scope_TmpClip[id], 4)
		set_pdata_float(weapon_entity, 48, 3.0, 4)
		set_pdata_float(id, 83, 3.0, 5)
		set_pdata_int(weapon_entity, 54, 1, 4)
		UTIL_weapon_anim(id, weapon_entity, 1)
	}
	return HAM_IGNORED
}

public Fw_Reload(weapon_entity) 
{
	new id = pev(weapon_entity, pev_owner)
	if (!is_user_valid(id) || ze_is_user_zombie(id))
		return HAM_IGNORED

	static iClipExtra
	if(g_Hasscope[id])
	{
		iClipExtra = get_pcvar_num(Cvar_scope_Clip)
	}

	g_scope_TmpClip[id] = -1
	
	new iBpAmmo = cs_get_user_bpammo(id, CSW_WEAPON_BASE)
	new iClip = get_pdata_int(weapon_entity, 51, 4)

	if (iBpAmmo <= 0 || iClip >= iClipExtra)
		return HAM_SUPERCEDE
		
	g_scope_TmpClip[id] = iClip

	return HAM_IGNORED
}

public Fw_AddToPlayer(ent, id)
{
	if(!is_valid_ent(ent) || !is_user_valid(id) || ze_is_user_zombie(id))
		return HAM_IGNORED
	
	if(entity_get_int(ent, EV_INT_impulse) == WEAPON_KEY)
	{
		g_Hasscope[id] = true
		g_hasZoom[id] = false
		cs_set_user_zoom(id, CS_RESET_ZOOM, 0)
		entity_set_int(ent, EV_INT_impulse, 0)
		
		message_begin(MSG_ONE, get_user_msgid("WeaponList"), {0, 0, 0}, id)
		write_string(CSW_NEW_WEAPON)
		write_byte(7)
		write_byte(100)
		write_byte(-1)
		write_byte(-1)
		write_byte(0)
		write_byte(8)
		write_byte(CSW_WEAPON_BASE)
		write_byte(0)
		message_end()
		return HAM_HANDLED
	}
	else
	{
		message_begin(MSG_ONE, get_user_msgid("WeaponList"), {0, 0, 0}, id)
		write_string(CSW_OLD_WEAPON)
		write_byte(7)
		write_byte(100)
		write_byte(-1)
		write_byte(-1)
		write_byte(0)
		write_byte(8)
		write_byte(CSW_WEAPON_BASE)
		write_byte(0)
		message_end()
	}
	return HAM_IGNORED
}

public Fw_Precache_Event(type, const name[])
{
	if(equal("events/p90.sc", name))
	{
		g_Eventscope = get_orig_retval()
	}
}

public Fw_Update_Clientdata(id, sendweapons, cd_handle)
{
	if(!is_user_valid(id))
		return

	if(get_user_weapon(id) == CSW_WEAPON_BASE && g_Hasscope[id])
	{
		set_cd(cd_handle, CD_flNextAttack, halflife_time() + 0.001)
	}
}

public Fw_Playback_Event(flags, invoker, eventid, Float:delay, Float:origin[3], Float:angles[3], Float:fparam1, Float:fparam2, iParam1, iParam2, bParam1, bParam2)
{
	if(!is_user_valid(invoker) || !g_IsInPrimaryAttack)
		return
    
	if(eventid == g_Eventscope && get_user_weapon(invoker) == CSW_WEAPON_BASE && g_Hasscope[invoker])
	{
		engfunc(EngFunc_PlaybackEvent, flags | FEV_HOSTONLY, invoker, eventid, delay, origin, angles, fparam1, fparam2, iParam1, iParam2, bParam1, bParam2)
		UTIL_weapon_anim(invoker, eventid, random_num(3, 5))
		emit_sound(invoker, CHAN_WEAPON, Weapon_Sounds[random_num(0, 1)], VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
	}
}

public ze_user_humanized(id)
{
	if(!is_user_valid(id))
		return
		
	Remove_scope(id)
}

public ze_user_infected(id, infector)
{
	if(!is_user_valid(id))
		return
		
	Remove_scope(id)
}

public Fw_PrimaryAttack(Weapon)
{
	g_IsInPrimaryAttack = 0
	
	new szClip, szAmmo, id
	id = get_pdata_cbase(Weapon, 41, 4)
	get_user_weapon(id, szClip, szAmmo)
	if(!is_user_valid(id) || ze_is_user_zombie(id))
		return

	g_IsInPrimaryAttack = 1
	if(g_Hasscope[id])
	{
		if (!cs_get_weapon_ammo(Weapon))
			return

		new Float:push[3]
		pev(id, pev_punchangle, push)
		xs_vec_sub(push, cl_pushangle[id], push)
		xs_vec_mul_scalar(push, get_pcvar_float(Cvar_scope_Recoil), push)
		xs_vec_add(push, cl_pushangle[id], push)
		set_pev(id, pev_punchangle, push)
		UTIL_weapon_anim(id, Weapon, random_num(3, 5))
		emit_sound(id, CHAN_WEAPON, Weapon_Sounds[random_num(0, 1)], VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
	}
}

public Fw_CmdStart(id, handle)
{
	if(!is_user_valid(id) || ze_is_user_zombie(id))
		return
		
	if((get_uc(handle, UC_Buttons) & IN_ATTACK2) && !(pev(id, pev_oldbuttons) & IN_ATTACK2))
	{
		if(get_user_weapon(id) == CSW_WEAPON_BASE && g_Hasscope[id] && !g_hasZoom[id])
		{
			g_hasZoom[id] = true
			cs_set_user_zoom(id, CS_SET_FIRST_ZOOM, 0)
		}
		else if(get_user_weapon(id) == CSW_WEAPON_BASE && g_Hasscope[id] && g_hasZoom[id])
		{
			g_hasZoom[id] = false
			cs_set_user_zoom(id, CS_RESET_ZOOM, 0)
		}
	}
}

public Fw_Take_DMG(Victim, Inflictor, Attacker, Float:Damage, DamageType)
{
	if(!is_user_valid(Victim) || !is_user_valid(Attacker) ||ze_is_user_zombie(Attacker))
		return
	
	if(get_user_weapon(Attacker) == CSW_WEAPON_BASE && g_Hasscope[Attacker])
	{
		SetHamParamFloat(4, Damage * get_pcvar_float(Cvar_scope_DMG))
	}
}

public Fw_PrimaryAttack_Post(Weapon)
{
	g_IsInPrimaryAttack = 0
	new szClip, szAmmo, id
	id = get_pdata_cbase(Weapon, 41, 4)
	get_user_weapon(id, szClip, szAmmo)
	
	if(!is_user_valid(id) || ze_is_user_zombie(id))
		return

	if(g_Hasscope[id])
	{
		if (!cs_get_weapon_ammo(Weapon))
			return

		new Float:push[3]
		pev(id, pev_punchangle, push)
		xs_vec_sub(push, cl_pushangle[id], push)
		xs_vec_mul_scalar(push, get_pcvar_float(Cvar_scope_Recoil), push)
		xs_vec_add(push, cl_pushangle[id], push)
		set_pev(id, pev_punchangle, push)
		UTIL_weapon_anim(id, Weapon, random_num(3, 5))
		emit_sound(id, CHAN_WEAPON, Weapon_Sounds[random_num(0, 1)], VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
	}
}

public Fw_Set_Model(entity, model[])
{
	if(!pev_valid(entity) || !equal(model, OLD_WEAPON))
		return FMRES_IGNORED
	
	static szClassName[33], id
	id = pev(entity, pev_owner)
	pev(entity, pev_classname, szClassName, charsmax(szClassName))
	if(!equal(szClassName, "weaponbox"))
		return FMRES_IGNORED
	
	if(g_Hasscope[id] && pev_valid(fm_find_ent_by_owner(-1, CSW_OLD_WEAPON, entity)))
	{
		g_Hasscope[id] = false
		g_hasZoom[id] = false
		cs_set_user_zoom(id, CS_RESET_ZOOM, 0)
		set_pev(fm_find_ent_by_owner(-1, CSW_OLD_WEAPON, entity), pev_impulse, WEAPON_KEY)
		engfunc(EngFunc_SetModel, entity, Weapon_Models[2])
		return FMRES_SUPERCEDE
	}
	return FMRES_IGNORED
}

public CurrentWeapon(id)
{
	if(!is_user_valid(id))
		return
		
	if(get_user_weapon(id) == CSW_WEAPON_BASE && g_Hasscope[id])
	{
		if(g_hasZoom[id])
		{
			cs_set_player_view_model(id, CSW_WEAPON_BASE, "")
		}
		else if(!g_hasZoom[id])
		{
			cs_set_player_view_model(id, CSW_WEAPON_BASE, Weapon_Models[0])
		}
		cs_set_player_weap_model(id, CSW_WEAPON_BASE, Weapon_Models[1])
		
		message_begin(MSG_ONE, get_user_msgid("WeaponList"), {0, 0, 0}, id)
		write_string(CSW_NEW_WEAPON)
		write_byte(7)
		write_byte(100)
		write_byte(-1)
		write_byte(-1)
		write_byte(0)
		write_byte(8)
		write_byte(CSW_WEAPON_BASE)
		write_byte(0)
		message_end()
		
		static Float:iSpeed; iSpeed = get_pcvar_float(Cvar_scope_Speed)
		static Ent; Ent = find_ent_by_owner(-1, CSW_OLD_WEAPON, id)
		if(Ent)
		{
			static Float:Delay; Delay = get_pdata_float( Ent, 46, 4) * iSpeed
			if (Delay > 0.0)
			{
				set_pdata_float(Ent, 46, Delay, 4)
			}
		}
	}
}

public DeathMsg(msg_id, msg_dest, id)
{
	static szTruncatedWeapon[33], iAttacker, iVictim
	get_msg_arg_string(4, szTruncatedWeapon, charsmax(szTruncatedWeapon))
	
	iAttacker = get_msg_arg_int(1)
	iVictim = get_msg_arg_int(2)
	
	if(!is_user_valid(iAttacker) || iAttacker == iVictim)	return
	
	if(equal(szTruncatedWeapon, "p90") && get_user_weapon(iAttacker) == CSW_WEAPON_BASE && g_Hasscope[iAttacker])
	{
		set_msg_arg_string(4, "lycanthrope")
	}
}

public ze_select_item_pre(id, itemid)
{
    // This not our item?
    if (itemid != scope)
        return ZE_ITEM_AVAILABLE
   
    // Available for Humans only, So don't show it for zombies	// Player Not VIP?
    if (ze_is_user_zombie(id) || !(ze_get_vip_flags(id) & VIP_ACCESS))
        return ZE_ITEM_DONT_SHOW
   
    // Finally return that it's available
    return ZE_ITEM_AVAILABLE
}

public ze_select_item_post(id, itemid)
{
	if(itemid != scope)
		return
		
	Givescope(id)
}

public Givescope(id)
{
	drop_weapons(id, 1)
	new wep = give_item(id, CSW_OLD_WEAPON)
	if (wep > 0)
	{
		cs_set_weapon_ammo(wep, get_pcvar_num(Cvar_scope_Clip))
		cs_set_user_bpammo(id, CSW_WEAPON_BASE, get_pcvar_num(Cvar_scope_Ammo))
		
		message_begin(MSG_ONE, get_user_msgid("WeaponList"), {0, 0, 0}, id)
		write_string(CSW_NEW_WEAPON)
		write_byte(7)
		write_byte(100)
		write_byte(-1)
		write_byte(-1)
		write_byte(0)
		write_byte(8)
		write_byte(CSW_WEAPON_BASE)
		write_byte(0)
		message_end()
	}
	g_Hasscope[id] = true
	g_hasZoom[id] = false
	cs_set_user_zoom(id, CS_RESET_ZOOM, 0)
	UTIL_weapon_anim(id, CSW_WEAPON_BASE, 2)
	ze_colored_print(id, "You bought Lycanthrope.")
}

public Remove_scope(id)
{
	if(!is_user_valid(id))
		return
		
	g_Hasscope[id] = false
	g_hasZoom[id] = false
	cs_set_user_zoom(id, CS_SET_NO_ZOOM, 0)
	message_begin(MSG_ONE, get_user_msgid("WeaponList"), {0, 0, 0}, id)
	write_string(CSW_OLD_WEAPON)
	write_byte(7)
	write_byte(100)
	write_byte(-1)
	write_byte(-1)
	write_byte(0)
	write_byte(8)
	write_byte(CSW_WEAPON_BASE)
	write_byte(0)
	message_end()
	cs_reset_player_view_model(id, CSW_WEAPON_BASE)
	cs_reset_player_weap_model(id, CSW_WEAPON_BASE)
}

UTIL_weapon_anim(index, entity, sequence = 0)
{
	set_pev(index, pev_weaponanim, sequence)

	message_begin(MSG_ONE_UNRELIABLE, SVC_WEAPONANIM, {0, 0, 0}, index)
	write_byte(sequence)
	write_byte(pev(entity, pev_body))
	message_end()
}

stock drop_weapons(id, dropwhat)
{
	static weapons[32], num, i, weaponid
	num = 0
	get_user_weapons(id, weapons, num)
	
	const PRIMARY_WEAPONS_BIT_SUM = (1<<CSW_SCOUT)|(1<<CSW_XM1014)|(1<<CSW_MAC10)|(1<<CSW_MAC10)|(1<<CSW_UMP45)|(1<<CSW_SG550)|(1<<CSW_MAC10)|(1<<CSW_FAMAS)|(1<<CSW_AWP)|(1<<CSW_MP5NAVY)|(1<<CSW_M249)|(1<<CSW_M3)|(1<<CSW_M4A1)|(1<<CSW_TMP)|(1<<CSW_G3SG1)|(1<<CSW_SG552)|(1<<CSW_AK47)|(1<<CSW_P90)
	
	for (i = 0; i < num; i++)
	{
		weaponid = weapons[i]
		
		if (dropwhat == 1 && ((1<<weaponid) & PRIMARY_WEAPONS_BIT_SUM))
		{
			static wname[32]
			get_weaponname(weaponid, wname, charsmax(wname))
			engclient_cmd(id, "drop", wname)
		}
	}
}
Want your own mod edition? PM me.
Accepting web projects.
CS 1.6 hosting: powergamingtech.com

johnnysins2000
Veteran Member
Veteran Member
Pakistan
Posts: 672
Joined: 3 Years Ago
Location: Lahore
Has thanked: 11 times
Been thanked: 10 times
Age: 23
Contact:

#9

Post by johnnysins2000 » 3 Years Ago

Jack GamePlay wrote:
3 Years Ago
With last VIP update.

Code: Select all

#include <ze_vip>
#include <fakemeta_util>
#include <cstrike>

#define VIP_ACCESS VIP_A 

#define CSW_WEAPON_BASE CSW_P90	
#define CSW_NEW_WEAPON	"weapon_lycanthrope"
#define CSW_OLD_WEAPON	"weapon_p90"
#define WEAPON_KEY	9299292
#define OLD_WEAPON	"models/w_p90.mdl"
#define is_user_valid(%1) (is_user_alive(%1) && !is_user_bot(%1) && !is_user_hltv(%1) && is_user_connected(%1))

new const Weapon_Models[][] = { "models/v_lycanthrope2.mdl", "models/p_lycanthrope.mdl", "models/w_lycanthrope.mdl" }
new const Weapon_Sounds[][] = { "weapons/sg552-1.wav", "weapons/sg552-2.wav", "weapons/buffsg552_draw.wav", "weapons/buffsg552_idle.wav", "weapons/buffsg552_reload.wav", "weapons/buffsg552_reload_AF.wav" }
new const Weapon_Sprites[][] = { "sprites/weapon_lycanthrope.txt", "sprites/640hud148.spr" }
new const GUNSHOT_DECALS[] = { 41, 42, 43, 44, 45 }

new scope, bool:g_Hasscope[33], g_hasZoom[33]
new Cvar_scope_Recoil, Cvar_scope_DMG, Cvar_scope_Clip, Cvar_scope_Ammo, Cvar_scope_Speed
new Float:cl_pushangle[33][3], g_Eventscope, g_scope_TmpClip[33], g_IsInPrimaryAttack, g_Shock

public plugin_precache()
{
	for(new g = 0; g < sizeof(Weapon_Models); g++)
		precache_model(Weapon_Models[g])
	for(new h = 0; h < sizeof(Weapon_Sounds); h++)
		precache_sound(Weapon_Sounds[h])
	for(new t = 0; t < sizeof(Weapon_Sprites); t++)
		precache_generic(Weapon_Sprites[t])
		
	g_Shock = precache_model("sprites/lycanthrope_hit.spr")
		
	register_clcmd(CSW_NEW_WEAPON, "hook")
	register_forward(FM_PrecacheEvent, "Fw_Precache_Event", 1)
}

public hook(id)
{
	engclient_cmd(id, CSW_OLD_WEAPON)
	return PLUGIN_HANDLED
}

public plugin_init()
{
	register_plugin("[ZE] Extra Item: Lycanthrope", "1.0", "Jack GamePlay")
	scope = ze_register_item("Lycanthrope", 1)
	
	// Events & Messages
	register_message(get_user_msgid("DeathMsg"), "DeathMsg")
	register_event("CurWeapon", "CurrentWeapon", "be", "1=1")
	register_event("HLTV", "New_Round", "a", "1=0", "2=0")
	
	// Forwards
	register_forward(FM_SetModel, "Fw_Set_Model", 1)
	register_forward(FM_PlaybackEvent, "Fw_Playback_Event")
	register_forward(FM_UpdateClientData, "Fw_Update_Clientdata", 1)
	register_forward(FM_CmdStart, "Fw_CmdStart")
	
	// Hook Chains
	RegisterHookChain(RG_CBasePlayer_TakeDamage, "Fw_Take_DMG")
	// Hams
	RegisterHam(Ham_Weapon_PrimaryAttack, CSW_OLD_WEAPON, "Fw_PrimaryAttack")
	RegisterHam(Ham_Weapon_PrimaryAttack, CSW_OLD_WEAPON, "Fw_PrimaryAttack_Post", 1)
	RegisterHam(Ham_Item_AddToPlayer, CSW_OLD_WEAPON, "Fw_AddToPlayer")
	RegisterHam(Ham_Weapon_Reload, CSW_OLD_WEAPON, "Fw_Reload")
	RegisterHam(Ham_Weapon_Reload, CSW_OLD_WEAPON, "Fw_Reload_Post", 1)
	RegisterHam(Ham_Spawn, "player", "Fw_Spawn", 1)
	RegisterHam(Ham_TraceAttack, "worldspawn", "Fw_TraceAttack", 1)
	RegisterHam(Ham_TraceAttack, "func_breakable", "Fw_TraceAttack", 1)
	RegisterHam(Ham_TraceAttack, "func_wall", "Fw_TraceAttack", 1)
	RegisterHam(Ham_TraceAttack, "func_door", "Fw_TraceAttack", 1)
	RegisterHam(Ham_TraceAttack, "func_door_rotating", "Fw_TraceAttack", 1)
	RegisterHam(Ham_TraceAttack, "func_plat", "Fw_TraceAttack", 1)
	RegisterHam(Ham_TraceAttack, "func_rotating", "Fw_TraceAttack", 1)
	RegisterHam(Ham_Use, "func_tank", "Fw_UseStationary_Post", 1)
	RegisterHam(Ham_Use, "func_tankmortar", "Fw_UseStationary_Post", 1)
	RegisterHam(Ham_Use, "func_tankrocket", "Fw_UseStationary_Post", 1)
	RegisterHam(Ham_Use, "func_tanklaser", "Fw_UseStationary_Post", 1)
	RegisterHam(Ham_Item_Deploy, CSW_OLD_WEAPON, "Fw_Item_Deploy_Post", 1)
	
	// Cvars
	Cvar_scope_Recoil = register_cvar("ze_scope_recoil", "1.0")
	Cvar_scope_DMG = register_cvar("ze_scope_damage", "6")
	Cvar_scope_Clip = register_cvar("ze_scope_clip", "30")
	Cvar_scope_Ammo = register_cvar("ze_scope_ammo", "150")
	Cvar_scope_Speed = register_cvar("ze_scope_speed", "4.5")
}

public Fw_Item_Deploy_Post(weapon_ent)
{
	new id = get_pdata_cbase(weapon_ent, 41, 4)
	g_hasZoom[id] = false
	cs_set_user_zoom(id, CS_RESET_ZOOM, 0)
	CurrentWeapon(id)
}

public Fw_UseStationary_Post(entity, caller, activator, use_type)
{
	if (use_type == 0 && is_user_valid(caller))
	{
		CurrentWeapon(caller)
	}
}

public Fw_TraceAttack(iEnt, iAttacker, Float:flDamage, Float:fDir[3], ptr, iDamageType)
{
	if(!is_user_valid(iAttacker))
		return
	
	static Float:flEnd[3]
	get_tr2(ptr, TR_vecEndPos, flEnd)
	
	if(get_user_weapon(iAttacker) == CSW_WEAPON_BASE && g_Hasscope[iAttacker])
	{
		if(iEnt)
		{
			message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
			write_byte(TE_DECAL)
			engfunc(EngFunc_WriteCoord, flEnd[0])
			engfunc(EngFunc_WriteCoord, flEnd[1])
			engfunc(EngFunc_WriteCoord, flEnd[2])
			write_byte(GUNSHOT_DECALS[random_num (0, sizeof GUNSHOT_DECALS -1)])
			write_short(iEnt)
			message_end()
		}
		else
		{
			message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
			write_byte(TE_WORLDDECAL)
			engfunc(EngFunc_WriteCoord, flEnd[0])
			engfunc(EngFunc_WriteCoord, flEnd[1])
			engfunc(EngFunc_WriteCoord, flEnd[2])
			write_byte(GUNSHOT_DECALS[random_num (0, sizeof GUNSHOT_DECALS -1)])
			message_end()
		}
		message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
		write_byte(TE_GUNSHOTDECAL)
		engfunc(EngFunc_WriteCoord, flEnd[0])
		engfunc(EngFunc_WriteCoord, flEnd[1])
		engfunc(EngFunc_WriteCoord, flEnd[2])
		write_short(iAttacker)
		write_byte(GUNSHOT_DECALS[random_num (0, sizeof GUNSHOT_DECALS -1)])
		message_end()
		
		engfunc(EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, flEnd, 0)
		write_byte(TE_SPRITE)
		engfunc(EngFunc_WriteCoord, flEnd[0])
		engfunc(EngFunc_WriteCoord, flEnd[1])
		engfunc(EngFunc_WriteCoord, flEnd[2])
		write_short(g_Shock)
		write_byte(5)
		write_byte(150)
		message_end()
	}
}

public Fw_Spawn(id)
{
	if(!is_user_valid(id))
		return
		
	Remove_scope(id)
}

public New_Round()
{
	for(new i = 0; i < get_member_game(m_nMaxPlayers); i++)
	{
		if(!is_user_valid(i) || !g_Hasscope[i])
			continue
			
		Remove_scope(i)
	}
}

public Fw_Reload_Post(weapon_entity) 
{
	new id = pev(weapon_entity, pev_owner)
	if (!is_user_valid(id) || ze_is_user_zombie(id) || g_scope_TmpClip[id] == -1)
		return HAM_IGNORED
		
	if(g_Hasscope[id])
	{
		g_hasZoom[id] = false
		cs_set_user_zoom(id, CS_RESET_ZOOM, 0)
		set_pdata_int(weapon_entity, 51, g_scope_TmpClip[id], 4)
		set_pdata_float(weapon_entity, 48, 3.0, 4)
		set_pdata_float(id, 83, 3.0, 5)
		set_pdata_int(weapon_entity, 54, 1, 4)
		UTIL_weapon_anim(id, weapon_entity, 1)
	}
	return HAM_IGNORED
}

public Fw_Reload(weapon_entity) 
{
	new id = pev(weapon_entity, pev_owner)
	if (!is_user_valid(id) || ze_is_user_zombie(id))
		return HAM_IGNORED

	static iClipExtra
	if(g_Hasscope[id])
	{
		iClipExtra = get_pcvar_num(Cvar_scope_Clip)
	}

	g_scope_TmpClip[id] = -1
	
	new iBpAmmo = cs_get_user_bpammo(id, CSW_WEAPON_BASE)
	new iClip = get_pdata_int(weapon_entity, 51, 4)

	if (iBpAmmo <= 0 || iClip >= iClipExtra)
		return HAM_SUPERCEDE
		
	g_scope_TmpClip[id] = iClip

	return HAM_IGNORED
}

public Fw_AddToPlayer(ent, id)
{
	if(!is_valid_ent(ent) || !is_user_valid(id) || ze_is_user_zombie(id))
		return HAM_IGNORED
	
	if(entity_get_int(ent, EV_INT_impulse) == WEAPON_KEY)
	{
		g_Hasscope[id] = true
		g_hasZoom[id] = false
		cs_set_user_zoom(id, CS_RESET_ZOOM, 0)
		entity_set_int(ent, EV_INT_impulse, 0)
		
		message_begin(MSG_ONE, get_user_msgid("WeaponList"), {0, 0, 0}, id)
		write_string(CSW_NEW_WEAPON)
		write_byte(7)
		write_byte(100)
		write_byte(-1)
		write_byte(-1)
		write_byte(0)
		write_byte(8)
		write_byte(CSW_WEAPON_BASE)
		write_byte(0)
		message_end()
		return HAM_HANDLED
	}
	else
	{
		message_begin(MSG_ONE, get_user_msgid("WeaponList"), {0, 0, 0}, id)
		write_string(CSW_OLD_WEAPON)
		write_byte(7)
		write_byte(100)
		write_byte(-1)
		write_byte(-1)
		write_byte(0)
		write_byte(8)
		write_byte(CSW_WEAPON_BASE)
		write_byte(0)
		message_end()
	}
	return HAM_IGNORED
}

public Fw_Precache_Event(type, const name[])
{
	if(equal("events/p90.sc", name))
	{
		g_Eventscope = get_orig_retval()
	}
}

public Fw_Update_Clientdata(id, sendweapons, cd_handle)
{
	if(!is_user_valid(id))
		return

	if(get_user_weapon(id) == CSW_WEAPON_BASE && g_Hasscope[id])
	{
		set_cd(cd_handle, CD_flNextAttack, halflife_time() + 0.001)
	}
}

public Fw_Playback_Event(flags, invoker, eventid, Float:delay, Float:origin[3], Float:angles[3], Float:fparam1, Float:fparam2, iParam1, iParam2, bParam1, bParam2)
{
	if(!is_user_valid(invoker) || !g_IsInPrimaryAttack)
		return
    
	if(eventid == g_Eventscope && get_user_weapon(invoker) == CSW_WEAPON_BASE && g_Hasscope[invoker])
	{
		engfunc(EngFunc_PlaybackEvent, flags | FEV_HOSTONLY, invoker, eventid, delay, origin, angles, fparam1, fparam2, iParam1, iParam2, bParam1, bParam2)
		UTIL_weapon_anim(invoker, eventid, random_num(3, 5))
		emit_sound(invoker, CHAN_WEAPON, Weapon_Sounds[random_num(0, 1)], VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
	}
}

public ze_user_humanized(id)
{
	if(!is_user_valid(id))
		return
		
	Remove_scope(id)
}

public ze_user_infected(id, infector)
{
	if(!is_user_valid(id))
		return
		
	Remove_scope(id)
}

public Fw_PrimaryAttack(Weapon)
{
	g_IsInPrimaryAttack = 0
	
	new szClip, szAmmo, id
	id = get_pdata_cbase(Weapon, 41, 4)
	get_user_weapon(id, szClip, szAmmo)
	if(!is_user_valid(id) || ze_is_user_zombie(id))
		return

	g_IsInPrimaryAttack = 1
	if(g_Hasscope[id])
	{
		if (!cs_get_weapon_ammo(Weapon))
			return

		new Float:push[3]
		pev(id, pev_punchangle, push)
		xs_vec_sub(push, cl_pushangle[id], push)
		xs_vec_mul_scalar(push, get_pcvar_float(Cvar_scope_Recoil), push)
		xs_vec_add(push, cl_pushangle[id], push)
		set_pev(id, pev_punchangle, push)
		UTIL_weapon_anim(id, Weapon, random_num(3, 5))
		emit_sound(id, CHAN_WEAPON, Weapon_Sounds[random_num(0, 1)], VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
	}
}

public Fw_CmdStart(id, handle)
{
	if(!is_user_valid(id) || ze_is_user_zombie(id))
		return
		
	if((get_uc(handle, UC_Buttons) & IN_ATTACK2) && !(pev(id, pev_oldbuttons) & IN_ATTACK2))
	{
		if(get_user_weapon(id) == CSW_WEAPON_BASE && g_Hasscope[id] && !g_hasZoom[id])
		{
			g_hasZoom[id] = true
			cs_set_user_zoom(id, CS_SET_FIRST_ZOOM, 0)
		}
		else if(get_user_weapon(id) == CSW_WEAPON_BASE && g_Hasscope[id] && g_hasZoom[id])
		{
			g_hasZoom[id] = false
			cs_set_user_zoom(id, CS_RESET_ZOOM, 0)
		}
	}
}

public Fw_Take_DMG(Victim, Inflictor, Attacker, Float:Damage, DamageType)
{
	if(!is_user_valid(Victim) || !is_user_valid(Attacker) ||ze_is_user_zombie(Attacker))
		return
	
	if(get_user_weapon(Attacker) == CSW_WEAPON_BASE && g_Hasscope[Attacker])
	{
		SetHamParamFloat(4, Damage * get_pcvar_float(Cvar_scope_DMG))
	}
}

public Fw_PrimaryAttack_Post(Weapon)
{
	g_IsInPrimaryAttack = 0
	new szClip, szAmmo, id
	id = get_pdata_cbase(Weapon, 41, 4)
	get_user_weapon(id, szClip, szAmmo)
	
	if(!is_user_valid(id) || ze_is_user_zombie(id))
		return

	if(g_Hasscope[id])
	{
		if (!cs_get_weapon_ammo(Weapon))
			return

		new Float:push[3]
		pev(id, pev_punchangle, push)
		xs_vec_sub(push, cl_pushangle[id], push)
		xs_vec_mul_scalar(push, get_pcvar_float(Cvar_scope_Recoil), push)
		xs_vec_add(push, cl_pushangle[id], push)
		set_pev(id, pev_punchangle, push)
		UTIL_weapon_anim(id, Weapon, random_num(3, 5))
		emit_sound(id, CHAN_WEAPON, Weapon_Sounds[random_num(0, 1)], VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
	}
}

public Fw_Set_Model(entity, model[])
{
	if(!pev_valid(entity) || !equal(model, OLD_WEAPON))
		return FMRES_IGNORED
	
	static szClassName[33], id
	id = pev(entity, pev_owner)
	pev(entity, pev_classname, szClassName, charsmax(szClassName))
	if(!equal(szClassName, "weaponbox"))
		return FMRES_IGNORED
	
	if(g_Hasscope[id] && pev_valid(fm_find_ent_by_owner(-1, CSW_OLD_WEAPON, entity)))
	{
		g_Hasscope[id] = false
		g_hasZoom[id] = false
		cs_set_user_zoom(id, CS_RESET_ZOOM, 0)
		set_pev(fm_find_ent_by_owner(-1, CSW_OLD_WEAPON, entity), pev_impulse, WEAPON_KEY)
		engfunc(EngFunc_SetModel, entity, Weapon_Models[2])
		return FMRES_SUPERCEDE
	}
	return FMRES_IGNORED
}

public CurrentWeapon(id)
{
	if(!is_user_valid(id))
		return
		
	if(get_user_weapon(id) == CSW_WEAPON_BASE && g_Hasscope[id])
	{
		if(g_hasZoom[id])
		{
			cs_set_player_view_model(id, CSW_WEAPON_BASE, "")
		}
		else if(!g_hasZoom[id])
		{
			cs_set_player_view_model(id, CSW_WEAPON_BASE, Weapon_Models[0])
		}
		cs_set_player_weap_model(id, CSW_WEAPON_BASE, Weapon_Models[1])
		
		message_begin(MSG_ONE, get_user_msgid("WeaponList"), {0, 0, 0}, id)
		write_string(CSW_NEW_WEAPON)
		write_byte(7)
		write_byte(100)
		write_byte(-1)
		write_byte(-1)
		write_byte(0)
		write_byte(8)
		write_byte(CSW_WEAPON_BASE)
		write_byte(0)
		message_end()
		
		static Float:iSpeed; iSpeed = get_pcvar_float(Cvar_scope_Speed)
		static Ent; Ent = find_ent_by_owner(-1, CSW_OLD_WEAPON, id)
		if(Ent)
		{
			static Float:Delay; Delay = get_pdata_float( Ent, 46, 4) * iSpeed
			if (Delay > 0.0)
			{
				set_pdata_float(Ent, 46, Delay, 4)
			}
		}
	}
}

public DeathMsg(msg_id, msg_dest, id)
{
	static szTruncatedWeapon[33], iAttacker, iVictim
	get_msg_arg_string(4, szTruncatedWeapon, charsmax(szTruncatedWeapon))
	
	iAttacker = get_msg_arg_int(1)
	iVictim = get_msg_arg_int(2)
	
	if(!is_user_valid(iAttacker) || iAttacker == iVictim)	return
	
	if(equal(szTruncatedWeapon, "p90") && get_user_weapon(iAttacker) == CSW_WEAPON_BASE && g_Hasscope[iAttacker])
	{
		set_msg_arg_string(4, "lycanthrope")
	}
}

public ze_select_item_pre(id, itemid)
{
    // This not our item?
    if (itemid != scope)
        return ZE_ITEM_AVAILABLE
   
    // Available for Humans only, So don't show it for zombies	// Player Not VIP?
    if (ze_is_user_zombie(id) || !(ze_get_vip_flags(id) & VIP_ACCESS))
        return ZE_ITEM_DONT_SHOW
   
    // Finally return that it's available
    return ZE_ITEM_AVAILABLE
}

public ze_select_item_post(id, itemid)
{
	if(itemid != scope)
		return
		
	Givescope(id)
}

public Givescope(id)
{
	drop_weapons(id, 1)
	new wep = give_item(id, CSW_OLD_WEAPON)
	if (wep > 0)
	{
		cs_set_weapon_ammo(wep, get_pcvar_num(Cvar_scope_Clip))
		cs_set_user_bpammo(id, CSW_WEAPON_BASE, get_pcvar_num(Cvar_scope_Ammo))
		
		message_begin(MSG_ONE, get_user_msgid("WeaponList"), {0, 0, 0}, id)
		write_string(CSW_NEW_WEAPON)
		write_byte(7)
		write_byte(100)
		write_byte(-1)
		write_byte(-1)
		write_byte(0)
		write_byte(8)
		write_byte(CSW_WEAPON_BASE)
		write_byte(0)
		message_end()
	}
	g_Hasscope[id] = true
	g_hasZoom[id] = false
	cs_set_user_zoom(id, CS_RESET_ZOOM, 0)
	UTIL_weapon_anim(id, CSW_WEAPON_BASE, 2)
	ze_colored_print(id, "You bought Lycanthrope.")
}

public Remove_scope(id)
{
	if(!is_user_valid(id))
		return
		
	g_Hasscope[id] = false
	g_hasZoom[id] = false
	cs_set_user_zoom(id, CS_SET_NO_ZOOM, 0)
	message_begin(MSG_ONE, get_user_msgid("WeaponList"), {0, 0, 0}, id)
	write_string(CSW_OLD_WEAPON)
	write_byte(7)
	write_byte(100)
	write_byte(-1)
	write_byte(-1)
	write_byte(0)
	write_byte(8)
	write_byte(CSW_WEAPON_BASE)
	write_byte(0)
	message_end()
	cs_reset_player_view_model(id, CSW_WEAPON_BASE)
	cs_reset_player_weap_model(id, CSW_WEAPON_BASE)
}

UTIL_weapon_anim(index, entity, sequence = 0)
{
	set_pev(index, pev_weaponanim, sequence)

	message_begin(MSG_ONE_UNRELIABLE, SVC_WEAPONANIM, {0, 0, 0}, index)
	write_byte(sequence)
	write_byte(pev(entity, pev_body))
	message_end()
}

stock drop_weapons(id, dropwhat)
{
	static weapons[32], num, i, weaponid
	num = 0
	get_user_weapons(id, weapons, num)
	
	const PRIMARY_WEAPONS_BIT_SUM = (1<<CSW_SCOUT)|(1<<CSW_XM1014)|(1<<CSW_MAC10)|(1<<CSW_MAC10)|(1<<CSW_UMP45)|(1<<CSW_SG550)|(1<<CSW_MAC10)|(1<<CSW_FAMAS)|(1<<CSW_AWP)|(1<<CSW_MP5NAVY)|(1<<CSW_M249)|(1<<CSW_M3)|(1<<CSW_M4A1)|(1<<CSW_TMP)|(1<<CSW_G3SG1)|(1<<CSW_SG552)|(1<<CSW_AK47)|(1<<CSW_P90)
	
	for (i = 0; i < num; i++)
	{
		weaponid = weapons[i]
		
		if (dropwhat == 1 && ((1<<weaponid) & PRIMARY_WEAPONS_BIT_SUM))
		{
			static wname[32]
			get_weaponname(weaponid, wname, charsmax(wname))
			engclient_cmd(id, "drop", wname)
		}
	}
}
I also did the same :/

Did u got Compilation error?

Like me?
Nobody Is That Busy If They Make Time :roll:

johnnysins2000
Veteran Member
Veteran Member
Pakistan
Posts: 672
Joined: 3 Years Ago
Location: Lahore
Has thanked: 11 times
Been thanked: 10 times
Age: 23
Contact:

#10

Post by johnnysins2000 » 3 Years Ago

OO u removed zombie_escape.inc

OK I will also try next time like this
Nobody Is That Busy If They Make Time :roll:

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests