Approved [CSO] Extra Item: Lycanthrope

Zombies/Humans Extra-Items
User avatar
Night Fury
Mod Developer
Mod Developer
Posts: 677
Joined: 7 years ago
Contact:

[CSO] Extra Item: Lycanthrope

#1

Post by Night Fury » 7 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 912 times
    Lycanthrope.zip
    [ZE] Extra-Item: Lycanthrope
    (2.29 MiB) Downloaded 912 times
Have fun. :D
Last edited by Raheem 6 years ago, edited 1 time in total.
Reason: Updating to work with Zombie Escape v1.1
Want your own mod edition? PM me.
Accepting private projects.
Discord: Fury#7469
Image

johnnysins2000
Veteran Member
Veteran Member
Paraguay
Posts: 678
Joined: 7 years ago
Location: Paraguay
Contact:

#2

Post by johnnysins2000 » 7 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: 7 years ago
Contact:

#3

Post by SpartanMR » 7 years ago

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

johnnysins2000
Veteran Member
Veteran Member
Paraguay
Posts: 678
Joined: 7 years ago
Location: Paraguay
Contact:

#4

Post by johnnysins2000 » 7 years ago

SpartanMR wrote: 7 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: 7 years ago
Location: INDIA
Contact:

#5

Post by sam_bhosale4 » 6 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
Paraguay
Posts: 678
Joined: 7 years ago
Location: Paraguay
Contact:

#6

Post by johnnysins2000 » 6 years ago

sam_bhosale4 wrote: 6 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
Paraguay
Posts: 678
Joined: 7 years ago
Location: Paraguay
Contact:

#7

Post by johnnysins2000 » 6 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
Night Fury
Mod Developer
Mod Developer
Posts: 677
Joined: 7 years ago
Contact:

#8

Post by Night Fury » 6 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 private projects.
Discord: Fury#7469
Image

johnnysins2000
Veteran Member
Veteran Member
Paraguay
Posts: 678
Joined: 7 years ago
Location: Paraguay
Contact:

#9

Post by johnnysins2000 » 6 years ago

Jack GamePlay wrote: 6 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
Paraguay
Posts: 678
Joined: 7 years ago
Location: Paraguay
Contact:

#10

Post by johnnysins2000 » 6 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:

User avatar
Raheem
Mod Developer
Mod Developer
Posts: 2214
Joined: 7 years ago
Contact:

#11

Post by Raheem » 6 years ago

This #define VIP_ACCESS VIP_A Already defined in ze_vip so remove it.

Never define something which is already defined or compiler also will never understand what you mean :lol:
He who fails to plan is planning to fail

User avatar
sam_bhosale4
Mod Tester
Mod Tester
India
Posts: 109
Joined: 7 years ago
Location: INDIA
Contact:

#12

Post by sam_bhosale4 » 6 years ago

thanks johny and jacky :D
-=SeRious-GaminG|Zombie Escape[Alien vs. Predator]|Asia=-
206.189.132.169:40000
Image

User avatar
Spir0x
Veteran Member
Veteran Member
Tunisia
Posts: 641
Joined: 7 years ago
Location: Tunisia
Contact:

#13

Post by Spir0x » 6 years ago

Jack see your code won't compile man ! for Vips

Image

Code: Select all

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


#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/BraZZers_ZE/v_lycanthrope.mdl", "models/BraZZers_ZE/p_lycanthrope.mdl", "models/BraZZers_ZE/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)
		}
	}
}

User avatar
Raheem
Mod Developer
Mod Developer
Posts: 2214
Joined: 7 years ago
Contact:

#14

Post by Raheem » 6 years ago

By anyway this depend on which Compiler you use. But in your case in line number 482 change: VIP_ACCESS to VIP_A
Second thing include fun module like: #include <fun>
He who fails to plan is planning to fail

User avatar
Spir0x
Veteran Member
Veteran Member
Tunisia
Posts: 641
Joined: 7 years ago
Location: Tunisia
Contact:

#15

Post by Spir0x » 6 years ago

Ok added VIP_A and #include <fun>

Image

still 1 error.

Code: Select all

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

#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/BraZZers_ZE/v_lycanthrope.mdl", "models/BraZZers_ZE/p_lycanthrope.mdl", "models/BraZZers_ZE/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_A))
        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)
		}
	}
}

User avatar
Raheem
Mod Developer
Mod Developer
Posts: 2214
Joined: 7 years ago
Contact:

#16

Post by Raheem » 6 years ago

Line 46: Change scope = ze_register_item("Lycanthrope", 1) to scope = ze_register_item("Lycanthrope", 1, 0)
He who fails to plan is planning to fail

User avatar
Spir0x
Veteran Member
Veteran Member
Tunisia
Posts: 641
Joined: 7 years ago
Location: Tunisia
Contact:

#17

Post by Spir0x » 6 years ago

Good, Thanks !

LosT
Member
Member
Belgium
Posts: 13
Joined: 6 years ago
Contact:

#18

Post by LosT » 6 years ago

error to compile:

Code: Select all

//// ze_lycanthrope_VIP.sma
//
// C:\Users\rappe\Desktop\SCRIPTING-ZE1.2\ze_lycanthrope_VIP.sma(222) : error 017: undefined symbol "is_valid_ent"
// C:\Users\rappe\Desktop\SCRIPTING-ZE1.2\ze_lycanthrope_VIP.sma(225) : error 017: undefined symbol "entity_get_int"
// C:\Users\rappe\Desktop\SCRIPTING-ZE1.2\ze_lycanthrope_VIP.sma(230) : error 017: undefined symbol "entity_set_int"
// C:\Users\rappe\Desktop\SCRIPTING-ZE1.2\ze_lycanthrope_VIP.sma(230) : warning 215: expression has no effect
// C:\Users\rappe\Desktop\SCRIPTING-ZE1.2\ze_lycanthrope_VIP.sma(230) : error 001: expected token: ";", but found ")"
// C:\Users\rappe\Desktop\SCRIPTING-ZE1.2\ze_lycanthrope_VIP.sma(230) : error 029: invalid expression, assumed zero
// C:\Users\rappe\Desktop\SCRIPTING-ZE1.2\ze_lycanthrope_VIP.sma(230) : fatal error 107: too many error messages on one line
//
// Compilation aborted.
// 6 Errors.
// Could not locate output file C:\Users\rappe\Desktop\SCRIPTING-ZE1.2\compiled\ze_lycanthrope_VIP.amx (compile failed).
//
// Compilation Time: 1.44 sec

sma:

Code: Select all

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

#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/BraZZers_ZE/v_lycanthrope.mdl", "models/BraZZers_ZE/p_lycanthrope.mdl", "models/BraZZers_ZE/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, 0)
	
	// 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_A))
        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)
		}
	}
}

johnnysins2000
Veteran Member
Veteran Member
Paraguay
Posts: 678
Joined: 7 years ago
Location: Paraguay
Contact:

#19

Post by johnnysins2000 » 6 years ago

LosT wrote: 6 years ago error to compile:

Code: Select all

//// ze_lycanthrope_VIP.sma
//
// C:\Users\rappe\Desktop\SCRIPTING-ZE1.2\ze_lycanthrope_VIP.sma(222) : error 017: undefined symbol "is_valid_ent"
// C:\Users\rappe\Desktop\SCRIPTING-ZE1.2\ze_lycanthrope_VIP.sma(225) : error 017: undefined symbol "entity_get_int"
// C:\Users\rappe\Desktop\SCRIPTING-ZE1.2\ze_lycanthrope_VIP.sma(230) : error 017: undefined symbol "entity_set_int"
// C:\Users\rappe\Desktop\SCRIPTING-ZE1.2\ze_lycanthrope_VIP.sma(230) : warning 215: expression has no effect
// C:\Users\rappe\Desktop\SCRIPTING-ZE1.2\ze_lycanthrope_VIP.sma(230) : error 001: expected token: ";", but found ")"
// C:\Users\rappe\Desktop\SCRIPTING-ZE1.2\ze_lycanthrope_VIP.sma(230) : error 029: invalid expression, assumed zero
// C:\Users\rappe\Desktop\SCRIPTING-ZE1.2\ze_lycanthrope_VIP.sma(230) : fatal error 107: too many error messages on one line
//
// Compilation aborted.
// 6 Errors.
// Could not locate output file C:\Users\rappe\Desktop\SCRIPTING-ZE1.2\compiled\ze_lycanthrope_VIP.amx (compile failed).
//
// Compilation Time: 1.44 sec

sma:

Code: Select all

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

#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/BraZZers_ZE/v_lycanthrope.mdl", "models/BraZZers_ZE/p_lycanthrope.mdl", "models/BraZZers_ZE/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, 0)
	
	// 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_A))
        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)
		}
	}
}
Just do what Raheem said and it will compile

Jack needs to update this code
Nobody Is That Busy If They Make Time :roll:

User avatar
Night Fury
Mod Developer
Mod Developer
Posts: 677
Joined: 7 years ago
Contact:

#20

Post by Night Fury » 6 years ago

johnnysins2000 wrote: 6 years ago Just do what Raheem said and it will compile

Jack needs to update this code
Sure. Soon.
Want your own mod edition? PM me.
Accepting private projects.
Discord: Fury#7469
Image

Post Reply

Create an account or sign in to join the discussion

You need to be a member in order to post a reply

Create an account

Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute

Register

Sign in

Who is online

Users browsing this forum: No registered users and 4 guests