1- Zombie Plague 4.3 >> Zombie Escape
- We will try convert this Item: Golden M4A1
- Remove these lines:
- #include <amxmodx>
- #include <fakemeta>
- #include <fun>
- #include <hamsandwich>
- #include <cstrike>
- #include <zombieplague>
And add these ones instead:
- #include <zombie_escape>
- #include <cstrike>
This simply because these includes is already included in our zombie_escape.inc
- Remove this line:
- g_itemid = zp_register_extra_item("Golden M4A1", 20, ZP_TEAM_HUMAN)
Add this instead:
- g_itemid = ze_register_item("Golden M4A1", 20, 0)
- Add these lines anywhere, And these lines which decide if this item for Humans or for Zombies:
- public ze_select_item_pre(id, itemid)
- {
- // Return Available and we will block it in Post, So it dosen't affect other plugins
- if (itemid != g_itemid)
- 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
- return ZE_ITEM_AVAILABLE
- }
- Change these lines:
- public zp_extra_item_selected(player, itemid)
- {
- if ( itemid == g_itemid )
- {
- if ( user_has_weapon(player, CSW_M4A1) )
- {
- drop_prim(player)
- }
- give_item(player, "weapon_m4a1")
- client_print(player, print_chat, "[ZP] You bought Golden M4A1")
- g_HasM4[player] = true;
- }
- }
To:
- public ze_select_item_post(player, itemid)
- {
- if (itemid != g_itemid)
- return
- if (user_has_weapon(player, CSW_M4A1))
- {
- drop_prim(player)
- }
- give_item(player, "weapon_m4a1")
- client_print(player, print_chat, "[ZP] You bought Golden M4A1")
- g_HasM4[player] = true;
- }
- Change:
- zp_user_infected_post(id)
To:
- ze_user_infected(id, iInfector)
- Change ALL:
- zp_get_user_zombie(id)
To:
- ze_is_user_zombie(id)
- #include <zombie_escape>
- #include <cstrike>
- #define is_valid_player(%1) (1 <= %1 <= 32)
- new M4_V_MODEL[64] = "models/zombie_plague/v_golden_m4a1_UP.mdl"
- new M4_P_MODEL[64] = "models/zombie_plague/p_golden_m4a1_UP.mdl"
- /* Pcvars */
- new cvar_dmgmultiplier, cvar_goldbullets, cvar_custommodel, cvar_uclip
- // Item ID
- new g_itemid
- new bool:g_HasM4[33]
- new g_hasZoom[ 33 ]
- new bullets[ 33 ]
- // Sprite
- new m_spriteTexture
- const Wep_m4a1 = ((1<<CSW_M4A1))
- public plugin_init()
- {
- /* CVARS */
- cvar_dmgmultiplier = register_cvar("zp_goldenm4_dmg_multiplier", "12")
- cvar_custommodel = register_cvar("zp_goldenm4_custom_model", "1")
- cvar_goldbullets = register_cvar("zp_goldenm4_gold_bullets", "1")
- cvar_uclip = register_cvar("zp_goldenm4_unlimited_clip", "1")
- // Register The Plugin
- register_plugin("[ZE] Extra: Golden M4A1", "1.1", "Bill=Thailand=[UP]")
- // Register Zombie Plague extra item
- g_itemid = ze_register_item("Golden M4A1", 20, 0)
- // Death Msg
- register_event("DeathMsg", "Death", "a")
- // Weapon Pick Up
- register_event("WeapPickup","checkModel","b","1=19")
- // Current Weapon Event
- register_event("CurWeapon","checkWeapon","be","1=1")
- register_event("CurWeapon", "make_tracer", "be", "1=1", "3>0")
- // Ham TakeDamage
- RegisterHam(Ham_TakeDamage, "player", "fw_TakeDamage")
- register_forward( FM_CmdStart, "fw_CmdStart" )
- RegisterHam(Ham_Spawn, "player", "fwHamPlayerSpawnPost", 1)
- }
- public client_connect(id)
- {
- g_HasM4[id] = false
- }
- public client_disconnect(id)
- {
- g_HasM4[id] = false
- }
- public Death()
- {
- g_HasM4[read_data(2)] = false
- }
- public fwHamPlayerSpawnPost(id)
- {
- g_HasM4[id] = false
- }
- public plugin_precache()
- {
- precache_model(M4_V_MODEL)
- precache_model(M4_P_MODEL)
- m_spriteTexture = precache_model("sprites/dot.spr")
- precache_sound("weapons/zoom.wav")
- }
- public ze_user_infected(id, iInfector)
- {
- if (ze_is_user_zombie(id))
- {
- g_HasM4[id] = false
- }
- }
- public checkModel(id)
- {
- if (ze_is_user_zombie(id))
- return PLUGIN_HANDLED
- new szWeapID = read_data(2)
- if ( szWeapID == CSW_M4A1 && g_HasM4[id] == true && get_pcvar_num(cvar_custommodel) )
- {
- set_pev(id, pev_viewmodel2, M4_V_MODEL)
- set_pev(id, pev_weaponmodel2, M4_P_MODEL)
- }
- return PLUGIN_HANDLED
- }
- public checkWeapon(id)
- {
- new plrClip, plrAmmo, plrWeap[32]
- new plrWeapId
- plrWeapId = get_user_weapon(id, plrClip , plrAmmo)
- if (plrWeapId == CSW_M4A1 && g_HasM4[id])
- {
- checkModel(id)
- }
- else
- {
- return PLUGIN_CONTINUE
- }
- if (plrClip == 0 && get_pcvar_num(cvar_uclip))
- {
- // If the user is out of ammo..
- get_weaponname(plrWeapId, plrWeap, 31)
- // Get the name of their weapon
- give_item(id, plrWeap)
- engclient_cmd(id, plrWeap)
- engclient_cmd(id, plrWeap)
- engclient_cmd(id, plrWeap)
- }
- return PLUGIN_HANDLED
- }
- public fw_TakeDamage(victim, inflictor, attacker, Float:damage)
- {
- if ( is_valid_player( attacker ) && get_user_weapon(attacker) == CSW_M4A1 && g_HasM4[attacker] )
- {
- SetHamParamFloat(4, damage * get_pcvar_float( cvar_dmgmultiplier ) )
- }
- }
- public fw_CmdStart( id, uc_handle, seed )
- {
- if( !is_user_alive( id ) )
- return PLUGIN_HANDLED
- if( ( get_uc( uc_handle, UC_Buttons ) & IN_ATTACK2 ) && !( pev( id, pev_oldbuttons ) & IN_ATTACK2 ) )
- {
- new szClip, szAmmo
- new szWeapID = get_user_weapon( id, szClip, szAmmo )
- if( szWeapID == CSW_M4A1 && g_HasM4[id] == true && !g_hasZoom[id] == true)
- {
- g_hasZoom[id] = true
- cs_set_user_zoom( id, CS_SET_AUGSG552_ZOOM, 0 )
- emit_sound( id, CHAN_ITEM, "weapons/zoom.wav", 0.20, 2.40, 0, 100 )
- }
- else if ( szWeapID == CSW_M4A1 && g_HasM4[id] == true && g_hasZoom[id])
- {
- g_hasZoom[ id ] = false
- cs_set_user_zoom( id, CS_RESET_ZOOM, 0 )
- }
- }
- return PLUGIN_HANDLED
- }
- public make_tracer(id)
- {
- if (get_pcvar_num(cvar_goldbullets))
- {
- new clip,ammo
- new wpnid = get_user_weapon(id,clip,ammo)
- new pteam[16]
- get_user_team(id, pteam, 15)
- if ((bullets[id] > clip) && (wpnid == CSW_M4A1) && g_HasM4[id])
- {
- new vec1[3], vec2[3]
- get_user_origin(id, vec1, 1) // origin; your camera point.
- get_user_origin(id, vec2, 4) // termina; where your bullet goes (4 is cs-only)
- //BEAMENTPOINTS
- message_begin( MSG_BROADCAST,SVC_TEMPENTITY)
- write_byte (0) //TE_BEAMENTPOINTS 0
- write_coord(vec1[0])
- write_coord(vec1[1])
- write_coord(vec1[2])
- write_coord(vec2[0])
- write_coord(vec2[1])
- write_coord(vec2[2])
- write_short( m_spriteTexture )
- write_byte(1) // framestart
- write_byte(5) // framerate
- write_byte(2) // life
- write_byte(10) // width
- write_byte(0) // noise
- write_byte( 255 ) // r, g, b
- write_byte( 215 ) // r, g, b
- write_byte( 0 ) // r, g, b
- write_byte(200) // brightness
- write_byte(150) // speed
- message_end()
- }
- bullets[id] = clip
- }
- }
- public ze_select_item_pre(id, itemid)
- {
- // Return Available and we will block it in Post, So it dosen't affect other plugins
- if (itemid != g_itemid)
- 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
- return ZE_ITEM_AVAILABLE
- }
- public ze_select_item_post(player, itemid)
- {
- if (itemid != g_itemid)
- return
- if (user_has_weapon(player, CSW_M4A1))
- {
- drop_prim(player)
- }
- give_item(player, "weapon_m4a1")
- client_print(player, print_chat, "[ZP] You bought Golden M4A1")
- g_HasM4[player] = true;
- }
- stock drop_prim(id)
- {
- new weapons[32], num
- get_user_weapons(id, weapons, num)
- for (new i = 0; i < num; i++) {
- if (Wep_m4a1 & (1<<weapons[i]))
- {
- static wname[32]
- get_weaponname(weapons[i], wname, sizeof wname - 1)
- engclient_cmd(id, "drop", wname)
- }
- }
- }
1- Zombie Plague 5.0 >> Zombie Escape
- We will try convert this Item: Skull-3
- Remove these lines:
- #include <amxmodx>
- #include <engine>
- #include <fakemeta>
- #include <fakemeta_util>
- #include <hamsandwich>
- #include <cstrike>
- #include <fun>
- #include <zp50_core>
- #include <zp50_items>
And add these ones instead:
- #include <zombie_escape>
- #include <cstrike>
This simply because these includes is already included in our zombie_escape.inc
- Remove this line:
- g_skull3_id = zp_items_register("Skull-3 (Double Weapon)", 30)
Add this instead:
- g_skull3_id = ze_register_item("Skull-3 (Double Weapon)", 30, 0)
- Change these lines:
- public zp_fw_items_select_pre(id, itemid, ignorecost)
- {
- if (itemid != g_skull3_id)
- return ZP_ITEM_AVAILABLE;
- if (zp_core_is_zombie(id))
- return ZP_ITEM_DONT_SHOW
- return ZP_ITEM_AVAILABLE;
- }
- public zp_fw_items_select_post(id, itemid, ignorecost)
- {
- if(itemid != g_skull3_id)
- return PLUGIN_HANDLED
- drop_weapons(id, 1)
- g_had_skull3[id] = 1
- g_skull3_mode[id] = 1
- g_skull3_ammo[id] = 200
- g_skull3_changing[id] = 0
- g_zoomed[id] = 0
- g_oldspeed[id] = get_user_maxspeed(id)
- give_item(id, weapon_skull3_m1)
- give_item(id, weapon_skull3_m2)
- static skull3_ent
- skull3_ent = fm_find_ent_by_owner(-1, weapon_skull3_m1, id)
- set_pev(skull3_ent, pev_iuser4, SKULL3_M1_KEY)
- cs_set_weapon_ammo(skull3_ent, get_pcvar_num(cvar_clip_m1))
- cs_set_user_bpammo(id, CSW_SKULL3_M1, g_skull3_ammo[id])
- skull3_ent = fm_find_ent_by_owner(-1, weapon_skull3_m2, id)
- set_pev(skull3_ent, pev_iuser4, SKULL3_M2_KEY)
- cs_set_weapon_ammo(skull3_ent, get_pcvar_num(cvar_clip_m2))
- cs_set_user_bpammo(id, CSW_SKULL3_M2, g_skull3_ammo[id])
- engclient_cmd(id, weapon_skull3_m1)
- return PLUGIN_CONTINUE
- }
To:
- public ze_select_item_pre(id, itemid, ignorecost)
- {
- if (itemid != g_skull3_id)
- return ZE_ITEM_AVAILABLE;
- if (ze_is_user_zombie(id))
- return ZE_ITEM_DONT_SHOW
- return ZE_ITEM_AVAILABLE;
- }
- public ze_select_item_post(id, itemid, ignorecost)
- {
- if(itemid != g_skull3_id)
- return
- drop_weapons(id, 1)
- g_had_skull3[id] = 1
- g_skull3_mode[id] = 1
- g_skull3_ammo[id] = 200
- g_skull3_changing[id] = 0
- g_zoomed[id] = 0
- g_oldspeed[id] = get_user_maxspeed(id)
- give_item(id, weapon_skull3_m1)
- give_item(id, weapon_skull3_m2)
- static skull3_ent
- skull3_ent = fm_find_ent_by_owner(-1, weapon_skull3_m1, id)
- set_pev(skull3_ent, pev_iuser4, SKULL3_M1_KEY)
- cs_set_weapon_ammo(skull3_ent, get_pcvar_num(cvar_clip_m1))
- cs_set_user_bpammo(id, CSW_SKULL3_M1, g_skull3_ammo[id])
- skull3_ent = fm_find_ent_by_owner(-1, weapon_skull3_m2, id)
- set_pev(skull3_ent, pev_iuser4, SKULL3_M2_KEY)
- cs_set_weapon_ammo(skull3_ent, get_pcvar_num(cvar_clip_m2))
- cs_set_user_bpammo(id, CSW_SKULL3_M2, g_skull3_ammo[id])
- engclient_cmd(id, weapon_skull3_m1)
- }
- Change:
- zp_fw_core_infect_post(id)
To:
- ze_user_infected(id, iInfector)
- Change All:
- zp_core_is_zombie(id)
To:
- ze_is_user_zombie(id)
- #include <zombie_escape>
- #include <cstrike>
- #define PLUGIN "[ZE] Primary Weapon: Skull-3"
- #define VERSION "1.0"
- #define AUTHOR "Dias"
- #define weapon_skull3_m1 "weapon_mp5navy"
- #define weapon_skull3_m2 "weapon_p90"
- #define CSW_SKULL3_M1 CSW_MP5NAVY
- #define CSW_SKULL3_M2 CSW_P90
- #define SKULL3_M1_KEY 2082
- #define SKULL3_M2_KEY 2086
- const SILENT_BS = ((1<<CSW_USP)|(1<<CSW_SKULL3_M1))
- const SILENT_BS2 = ((1<<CSW_USP)|(1<<CSW_SKULL3_M2))
- stock const g_iDftMaxClip[CSW_P90+1] = {
- -1, 13, -1, 10, 1, 7, 1, 30, 30, 1, 30,
- 20, 25, 30, 35, 25, 12, 20, 10, 30, 100,
- 8 , 30, 30, 20, 2, 7, 30, 30, -1, 50}
- stock const Float:g_fDelay[CSW_P90+1] = {
- 0.00, 2.70, 0.00, 2.00, 0.00, 0.55, 0.00, 3.15, 3.30, 0.00, 4.50,
- 2.70, 3.50, 3.35, 2.45, 3.30, 2.70, 2.20, 2.50, 2.63, 4.70,
- 0.55, 3.05, 2.12, 3.50, 0.00, 2.20, 3.00, 2.45, 0.00, 3.40
- }
- new const WEAPONENTNAMES[][] =
- {
- "", "weapon_p228", "", "weapon_scout", "weapon_hegrenade", "weapon_xm1014", "weapon_c4", "weapon_mac10",
- "weapon_aug", "weapon_smokegrenade", "weapon_elite", "weapon_fiveseven", "weapon_ump45", "weapon_sg550",
- "weapon_galil", "weapon_famas", "weapon_usp", "weapon_glock18", "weapon_awp", "weapon_m249",
- "weapon_m3", "weapon_m4a1", "weapon_tmp", "weapon_g3sg1", "weapon_flashbang", "weapon_deagle", "weapon_sg552",
- "weapon_ak47", "weapon_knife"
- }
- 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)
- new g_skull3_id
- new g_had_skull3[33], g_skull3_mode[33], g_skull3_ammo[33], g_skull3_changing[33],
- g_zoomed[33], g_remove_ent[33], g_blood, g_bloodspray, g_pbe_skull3_m1,
- g_pbe_skull3_m2, g_is_attacking[33], Float:g_zoom_time[33], g_skull3_m2_ammo[33],
- Float:g_recoil[33], g_shot_anim[33], g_skull3_clip[33], g_reload[33], g_reg
- new cvar_recoil_m1, cvar_recoil_m2, cvar_clip_m1, cvar_clip_m2, cvar_speed_m1, cvar_speed_m2,
- cvar_damage_m1, cvar_damage_m2, cvar_decrease_speed
- new Float:g_oldspeed[33]
- new const v_model[] = "models/zombie_plague/v_skull3.mdl"
- new const v_model2[] = "models/zombie_plague/v_skull3_2.mdl"
- new const p_model[] = "models/zombie_plague/p_skull3.mdl"
- new const p_model2[] = "models/zombie_plague/p_skull3dual.mdl"
- new const w_model[] = "models/zombie_plague/w_skull3.mdl"
- new const skull3_sound[5][] =
- {
- "weapons/skull3_shoot.wav",
- "weapons/skull3_shoot_2.wav",
- "weapons/skull3_idle.wav",
- "weapons/skull3_clipin.wav",
- "weapons/skull3_boltpull.wav"
- }
- public plugin_init()
- {
- register_plugin(PLUGIN, VERSION, AUTHOR)
- g_skull3_id = ze_register_item("Skull-3 (Double Weapon)", 30, 0)
- register_forward(FM_CmdStart, "fw_CmdStart")
- register_forward(FM_UpdateClientData, "fw_UpdateClientData_Post", 1)
- register_forward(FM_PlaybackEvent, "fw_PlaybackEvent")
- register_forward(FM_SetModel, "fw_SetModel")
- RegisterHam(Ham_Spawn, "player", "ham_spawn_player_post", 1)
- RegisterHam(Ham_Item_AddToPlayer, weapon_skull3_m1, "ham_add_skull3_m1", 1)
- RegisterHam(Ham_Item_AddToPlayer, weapon_skull3_m2, "ham_add_skull3_m2", 1)
- RegisterHam(Ham_CS_Weapon_SendWeaponAnim, weapon_skull3_m1, "ham_anim_skull3_m1", 1)
- RegisterHam(Ham_CS_Weapon_SendWeaponAnim, weapon_skull3_m2, "ham_anim_skull3_m2", 1)
- RegisterHam(Ham_Item_Deploy, weapon_skull3_m1, "ham_deploy_skull3_m1", 1)
- RegisterHam(Ham_Item_Deploy, weapon_skull3_m2, "ham_deploy_skull3_m2", 1)
- for (new i = 1; i <= CSW_P90 - 2; i++)
- {
- if (strlen(WEAPONENTNAMES[i]) && !equal(WEAPONENTNAMES[i], "weapon_knife"))
- RegisterHam(Ham_Item_Deploy, WEAPONENTNAMES[i], "fw_Ham_Item_Deploy_Post", 1)
- }
- RegisterHam(Ham_Weapon_PrimaryAttack, weapon_skull3_m1, "ham_attack_skull3")
- RegisterHam(Ham_Weapon_PrimaryAttack, weapon_skull3_m2, "ham_attack_skull3")
- RegisterHam(Ham_Weapon_PrimaryAttack, weapon_skull3_m1, "ham_attack_skull3_post", 1)
- RegisterHam(Ham_Weapon_PrimaryAttack, weapon_skull3_m2, "ham_attack_skull3_post", 1)
- RegisterHam(Ham_Weapon_Reload, weapon_skull3_m1, "ham_reload_skull3")
- RegisterHam(Ham_Weapon_Reload, weapon_skull3_m2, "ham_reload_skull3")
- RegisterHam(Ham_Weapon_Reload, weapon_skull3_m1, "ham_reload_skull3_post", 1)
- RegisterHam(Ham_Weapon_Reload, weapon_skull3_m2, "ham_reload_skull3_post", 1)
- RegisterHam(Ham_Item_PostFrame, weapon_skull3_m1, "ham_postframe_skull3")
- RegisterHam(Ham_Item_PostFrame, weapon_skull3_m2, "ham_postframe_skull3")
- RegisterHam(Ham_TraceAttack, "worldspawn", "ham_traceattack")
- RegisterHam(Ham_TraceAttack, "player", "ham_traceattack")
- cvar_recoil_m1 = register_cvar("skull3_recoil_m1", "0.46")
- cvar_recoil_m2 = register_cvar("skull3_recoil_m2", "0.56")
- cvar_clip_m1 = register_cvar("skull3_clip_m1", "35")
- cvar_clip_m2 = register_cvar("skull3_clip_m2", "70")
- cvar_speed_m1 = register_cvar("skull3_speed_m1", "1.35")
- cvar_speed_m2 = register_cvar("skull3_speed_m2", "1.28")
- cvar_damage_m1 = register_cvar("skull3_damage_m1", "27")
- cvar_damage_m2 = register_cvar("skull3_damage_m2", "31")
- cvar_decrease_speed = register_cvar("skull3_decrease_speed", "110.0")
- register_event("CurWeapon", "event_checkweapon", "be", "1=1")
- register_clcmd("drop", "cmd_drop")
- register_clcmd("weapon_skull3", "hook_change_weapon1")
- register_clcmd("weapon_skull3_2", "hook_change_weapon2")
- }
- public plugin_precache()
- {
- engfunc(EngFunc_PrecacheModel, v_model)
- engfunc(EngFunc_PrecacheModel, v_model2)
- engfunc(EngFunc_PrecacheModel, p_model)
- engfunc(EngFunc_PrecacheModel, p_model2)
- engfunc(EngFunc_PrecacheModel, w_model)
- for(new i = 0; i < sizeof(skull3_sound); i++)
- engfunc(EngFunc_PrecacheSound, skull3_sound[i])
- engfunc(EngFunc_PrecacheGeneric, "sprites/skull3_hud.spr")
- engfunc(EngFunc_PrecacheGeneric, "sprites/skull3_ammo.spr")
- engfunc(EngFunc_PrecacheGeneric, "sprites/weapon_skull3.txt")
- engfunc(EngFunc_PrecacheGeneric, "sprites/weapon_skull3_2.txt")
- g_blood = precache_model("sprites/blood.spr")
- g_bloodspray = precache_model("sprites/bloodspray.spr")
- register_forward(FM_PrecacheEvent, "fw_PrecacheEvent_Post", 1)
- }
- public fw_PrecacheEvent_Post(type, const name[])
- {
- if(equal("events/mp5n.sc", name))
- {
- g_pbe_skull3_m1 = get_orig_retval()
- return FMRES_HANDLED
- } else if(equal("events/p90.sc", name)) {
- g_pbe_skull3_m2 = get_orig_retval()
- return FMRES_HANDLED
- }
- return FMRES_IGNORED
- }
- public fw_PlaybackEvent(flags, invoker, eventid, Float:delay, Float:origin[3], Float:angles[3], Float:fparam1, Float:fparam2, iParam1, iParam2, bParam1, bParam2)
- {
- if (!(1 <= invoker <= get_maxplayers()))
- return FMRES_IGNORED
- if(!g_is_attacking[invoker])
- return FMRES_IGNORED
- if(eventid == g_pbe_skull3_m1 || eventid == g_pbe_skull3_m2)
- playback_event(flags | FEV_HOSTONLY, invoker, eventid, delay, origin, angles, fparam1, fparam2, iParam1, iParam2, bParam1, bParam2)
- return FMRES_SUPERCEDE
- }
- public ze_select_item_pre(id, itemid, ignorecost)
- {
- if (itemid != g_skull3_id)
- return ZE_ITEM_AVAILABLE;
- if (ze_is_user_zombie(id))
- return ZE_ITEM_DONT_SHOW
- return ZE_ITEM_AVAILABLE;
- }
- public ze_select_item_post(id, itemid, ignorecost)
- {
- if(itemid != g_skull3_id)
- return
- drop_weapons(id, 1)
- g_had_skull3[id] = 1
- g_skull3_mode[id] = 1
- g_skull3_ammo[id] = 200
- g_skull3_changing[id] = 0
- g_zoomed[id] = 0
- g_oldspeed[id] = get_user_maxspeed(id)
- give_item(id, weapon_skull3_m1)
- give_item(id, weapon_skull3_m2)
- static skull3_ent
- skull3_ent = fm_find_ent_by_owner(-1, weapon_skull3_m1, id)
- set_pev(skull3_ent, pev_iuser4, SKULL3_M1_KEY)
- cs_set_weapon_ammo(skull3_ent, get_pcvar_num(cvar_clip_m1))
- cs_set_user_bpammo(id, CSW_SKULL3_M1, g_skull3_ammo[id])
- skull3_ent = fm_find_ent_by_owner(-1, weapon_skull3_m2, id)
- set_pev(skull3_ent, pev_iuser4, SKULL3_M2_KEY)
- cs_set_weapon_ammo(skull3_ent, get_pcvar_num(cvar_clip_m2))
- cs_set_user_bpammo(id, CSW_SKULL3_M2, g_skull3_ammo[id])
- engclient_cmd(id, weapon_skull3_m1)
- }
- public ham_spawn_player_post(id)
- {
- remove_skull3(id)
- }
- public ze_user_infected(id, iInfector)
- {
- remove_skull3(id)
- }
- public remove_skull3(id)
- {
- if(!is_user_connected(id))
- return
- g_had_skull3[id] = 0
- g_skull3_mode[id] = 0
- g_skull3_ammo[id] = 0
- g_skull3_changing[id] = 0
- g_zoomed[id] = 0
- }
- public hook_change_weapon1(id)
- {
- if(g_had_skull3[id])
- {
- engclient_cmd(id, weapon_skull3_m1)
- }
- }
- public hook_change_weapon2(id)
- {
- if(g_had_skull3[id])
- {
- engclient_cmd(id, weapon_skull3_m2)
- }
- }
- public client_putinserver(id)
- {
- if(!g_reg && is_user_bot(id))
- {
- g_reg = 1
- set_task(0.1, "do_register", id)
- }
- }
- public do_register(id)
- {
- RegisterHamFromEntity(Ham_TraceAttack, id, "ham_traceattack")
- RegisterHamFromEntity(Ham_Spawn, id, "ham_spawn_player")
- }
- public event_checkweapon(id)
- {
- if(!is_user_alive(id) || !is_user_connected(id))
- return PLUGIN_HANDLED
- if(ze_is_user_zombie(id))
- return PLUGIN_HANDLED
- if(!g_had_skull3[id])
- return PLUGIN_HANDLED
- static CurWeapon
- CurWeapon = get_user_weapon(id)
- if(CurWeapon == CSW_SKULL3_M1 && g_skull3_mode[id] == 1)
- {
- set_pev(id, pev_viewmodel2, v_model)
- set_pev(id, pev_weaponmodel2, p_model)
- check_weapon_speed(id, 1)
- } else if(CurWeapon == CSW_SKULL3_M2 && g_skull3_mode[id] == 2) {
- set_pev(id, pev_viewmodel2, v_model2)
- set_pev(id, pev_weaponmodel2, p_model2)
- check_weapon_speed(id, 2)
- }
- return PLUGIN_CONTINUE
- }
- public check_weapon_speed(id, mode)
- {
- static Float:iSpeed
- if(mode == 1)
- iSpeed = get_pcvar_float(cvar_speed_m1)
- else if(mode == 2)
- iSpeed = get_pcvar_float(cvar_speed_m2)
- static weapon_name[32], ent
- if(mode == 1)
- get_weaponname(CSW_SKULL3_M1, weapon_name, sizeof(weapon_name))
- else if(mode == 2)
- get_weaponname(CSW_SKULL3_M2, weapon_name, sizeof(weapon_name))
- ent = find_ent_by_owner(-1, weapon_name, id)
- if(ent)
- {
- static Float:Delay, Float:M_Delay
- Delay = get_pdata_float(ent, 46, 4) * iSpeed
- M_Delay = get_pdata_float(ent, 47, 4) * iSpeed
- if (Delay > 0.0)
- {
- set_pdata_float(ent, 46, Delay, 4)
- set_pdata_float(ent, 47, M_Delay, 4)
- }
- }
- }
- public fw_UpdateClientData_Post(id, sendweapons, cd_handle)
- {
- if(!is_user_alive(id) || !is_user_connected(id))
- return FMRES_IGNORED
- if(ze_is_user_zombie(id))
- return FMRES_IGNORED
- if(!g_had_skull3[id])
- return FMRES_IGNORED
- if(get_user_weapon(id) == CSW_SKULL3_M1 || get_user_weapon(id) == CSW_SKULL3_M2)
- {
- set_cd(cd_handle, CD_flNextAttack, halflife_time() + 0.001)
- if(get_user_weapon(id) == CSW_SKULL3_M2)
- {
- switch(pev(id, pev_sequence))
- {
- case 10: set_pev(id, pev_sequence, 22)
- case 11:
- {
- if(g_shot_anim[id] == 0)
- {
- set_pev(id, pev_sequence, 23)
- } else if(g_shot_anim[id] == 1) {
- set_pev(id, pev_sequence, 24)
- }
- }
- case 12: set_pev(id, pev_sequence, 25)
- case 13: set_pev(id, pev_sequence, 26)
- case 14:
- {
- if(g_shot_anim[id] == 0)
- {
- set_pev(id, pev_sequence, 27)
- } else if(g_shot_anim[id] == 1) {
- set_pev(id, pev_sequence, 28)
- }
- }
- case 15: set_pev(id, pev_sequence, 29)
- }
- }
- }
- return FMRES_HANDLED
- }
- public cmd_drop(id)
- {
- if(get_user_weapon(id) == CSW_SKULL3_M1 || get_user_weapon(id) == CSW_SKULL3_M2 && g_had_skull3[id])
- {
- //return PLUGIN_HANDLED
- }
- return PLUGIN_CONTINUE
- }
- public fw_SetModel(entity, model[])
- {
- if(!is_valid_ent(entity))
- return FMRES_IGNORED;
- static szClassName[33]
- entity_get_string(entity, EV_SZ_classname, szClassName, charsmax(szClassName))
- if(!equal(szClassName, "weaponbox"))
- return FMRES_IGNORED;
- static id
- id = entity_get_edict(entity, EV_ENT_owner)
- if(equal(model, "models/w_mp5.mdl"))
- {
- static weapon
- weapon = find_ent_by_owner(-1, weapon_skull3_m1, entity)
- if(!pev_valid(weapon))
- return FMRES_IGNORED
- if(g_had_skull3[id])
- {
- static weapon2
- weapon2 = find_ent_by_owner(-1, weapon_skull3_m2, id)
- if(pev_valid(weapon2))
- {
- reset_player_maxspeed(id)
- g_skull3_m2_ammo[id] = cs_get_weapon_ammo(weapon2)
- g_remove_ent[id] = entity
- //ham_strip_weapon(id, weapon_skull3_m2)
- //fm_strip_user_gun(id, CSW_SKULL3_M2, weapon_skull3_m2)
- remove_gun(id, CSW_SKULL3_M2)
- client_cmd(id, "slot3")
- g_had_skull3[id] = 0
- entity_set_model(entity, w_model)
- entity_set_int(weapon, EV_INT_impulse, 2085)
- return FMRES_SUPERCEDE
- }
- }
- }
- if(equal(model, "models/w_p90.mdl"))
- {
- static weapon
- weapon = find_ent_by_owner(-1, weapon_skull3_m2, entity)
- if(!pev_valid(weapon))
- return FMRES_IGNORED
- if(g_had_skull3[id])
- {
- static weapon1
- weapon1 = find_ent_by_owner(-1, weapon_skull3_m1, id)
- reset_player_maxspeed(id)
- if(pev_valid(weapon1))
- {
- g_skull3_m2_ammo[id] = cs_get_weapon_ammo(weapon1)
- g_remove_ent[id] = entity
- //ham_strip_weapon(id, weapon_skull3_m1)
- //fm_strip_user_gun(id, CSW_SKULL3_M1, weapon_skull3_m1)
- remove_gun(id, CSW_SKULL3_M1)
- client_cmd(id, "slot3")
- g_had_skull3[id] = 0
- entity_set_model(entity, w_model)
- entity_set_int(weapon, EV_INT_impulse, 2085)
- return FMRES_SUPERCEDE
- }
- }
- }
- return FMRES_IGNORED;
- }
- public remove_gun(id, CSW)
- {
- new wpnList[32]
- new number
- get_user_weapons(id,wpnList,number)
- for (new i = 0;i < number ;i++) {
- if (wpnList[i] == CSW) {
- fm_strip_user_gun(id, wpnList[i])
- }
- }
- }
- public fw_CmdStart(id, uc_handle, seed)
- {
- if(!is_user_alive(id) || !is_user_connected(id))
- return FMRES_IGNORED
- if(ze_is_user_zombie(id))
- return FMRES_IGNORED
- if(!g_had_skull3[id])
- return FMRES_IGNORED
- if(get_user_weapon(id) != CSW_SKULL3_M1 || g_skull3_mode[id] != 1)
- return FMRES_IGNORED
- static CurButton
- CurButton = get_uc(uc_handle, UC_Buttons)
- if(CurButton & IN_ATTACK2)
- {
- static Float:CurTime
- CurTime = get_gametime()
- if(CurTime - 0.5 > g_zoom_time[id])
- {
- if(!g_zoomed[id])
- {
- cs_set_user_zoom(id, CS_SET_AUGSG552_ZOOM, 1)
- g_zoomed[id] = 1
- } else {
- cs_set_user_zoom(id, CS_RESET_ZOOM, 1)
- g_zoomed[id] = 0
- }
- g_zoom_time[id] = CurTime
- }
- }
- return FMRES_HANDLED
- }
- public ham_traceattack(ent, attacker, Float:Damage, Float:fDir[3], ptr, iDamageType)
- {
- if(!is_user_alive(attacker) || !is_user_connected(attacker))
- return HAM_IGNORED
- if(ze_is_user_zombie(attacker))
- return HAM_IGNORED
- if(!g_had_skull3[attacker])
- return HAM_IGNORED
- static Float:flEnd[3]
- get_tr2(ptr, TR_vecEndPos, flEnd)
- if(get_user_weapon(attacker) == CSW_SKULL3_M1)
- {
- make_bullet(attacker, flEnd)
- static Damage_New
- Damage_New = get_damage_body(get_tr2(ptr, TR_iHitgroup), get_pcvar_float(cvar_damage_m1))
- SetHamParamFloat(3, float(Damage_New))
- } else if(get_user_weapon(attacker) == CSW_SKULL3_M2) {
- static Damage_New
- Damage_New = get_damage_body(get_tr2(ptr, TR_iHitgroup), get_pcvar_float(cvar_damage_m2))
- SetHamParamFloat(3, float(Damage_New))
- }
- return HAM_HANDLED
- }
- public get_damage_body(body, Float:damage)
- {
- switch(body)
- {
- case HIT_HEAD: damage *= 4.0
- case HIT_CHEST: damage *= 1.5
- case HIT_STOMACH: damage *= 1.25
- default: damage *= 1.0
- }
- return floatround(damage)
- }
- public ham_add_skull3_m1(ent, id)
- {
- if(entity_get_int(ent, EV_INT_impulse) == 2085)
- {
- if(pev_valid(g_remove_ent[id]))
- {
- set_pev(g_remove_ent[id], pev_renderfx, kRenderFxGlowShell)
- set_pev(g_remove_ent[id], pev_rendermode, kRenderTransAlpha)
- set_pev(g_remove_ent[id], pev_renderamt, 0)
- set_pev(g_remove_ent[id], pev_solid, SOLID_NOT)
- //remove_entity(g_remove_ent[id])
- }
- g_had_skull3[id] = 1
- entity_set_int(id, EV_INT_impulse, 0)
- fm_give_item(id, weapon_skull3_m2)
- g_skull3_mode[id] = 1
- client_cmd(id, weapon_skull3_m1)
- static weapon
- weapon = find_ent_by_owner(-1, weapon_skull3_m2, id)
- cs_set_weapon_ammo(weapon, g_skull3_m2_ammo[id])
- set_pev(id, pev_viewmodel2, v_model)
- }
- if(g_had_skull3[id])
- {
- message_begin(MSG_ONE, get_user_msgid("WeaponList"), _, id)
- write_string("weapon_skull3")
- write_byte(10)
- write_byte(120)
- write_byte(-1)
- write_byte(-1)
- write_byte(0)
- write_byte(7)
- write_byte(CSW_SKULL3_M1)
- write_byte(0)
- message_end()
- }
- }
- public ham_add_skull3_m2(ent, id)
- {
- if(entity_get_int(ent, EV_INT_impulse) == 2085)
- {
- if(pev_valid(g_remove_ent[id]))
- {
- set_pev(g_remove_ent[id], pev_renderfx, kRenderFxGlowShell)
- set_pev(g_remove_ent[id], pev_rendermode, kRenderTransAlpha)
- set_pev(g_remove_ent[id], pev_renderamt, 0)
- set_pev(g_remove_ent[id], pev_solid, SOLID_NOT)
- //remove_entity(g_remove_ent[id])
- }
- g_had_skull3[id] = 1
- entity_set_int(id, EV_INT_impulse, 0)
- fm_give_item(id, weapon_skull3_m1)
- g_skull3_mode[id] = 2
- client_cmd(id, weapon_skull3_m2)
- static weapon
- weapon = find_ent_by_owner(-1, weapon_skull3_m1, id)
- cs_set_weapon_ammo(weapon, g_skull3_m2_ammo[id])
- set_pev(id, pev_viewmodel2, v_model2)
- }
- if(g_had_skull3[id])
- {
- message_begin(MSG_ONE, get_user_msgid("WeaponList"), _, id)
- write_string("weapon_skull3_2")
- write_byte(7)
- write_byte(100)
- write_byte(-1)
- write_byte(-1)
- write_byte(0)
- write_byte(8)
- write_byte(CSW_SKULL3_M2)
- write_byte(0)
- message_end()
- }
- }
- public ham_anim_skull3_m1(ent, anim, skiplocal, body)
- {
- if(!pev_valid(ent))
- return HAM_IGNORED
- static id
- id = pev(ent, pev_owner)
- if(is_user_alive(id) && is_user_connected(id) && g_had_skull3[id])
- {
- if(anim == 2)
- {
- if(g_skull3_mode[id] == 2)
- {
- g_skull3_changing[id] = 1
- set_pev(id, pev_viewmodel2, v_model)
- set_weapon_anim(id, 6)
- set_pdata_int(id, 83, 3, 5)
- set_task(3.0, "change_complete1", id)
- set_nextattack(ent, id, 3.0)
- //event_checkweapon(id)
- reset_player_maxspeed(id)
- } else if(g_skull3_mode[id] == 1) {
- if(!g_skull3_changing[id])
- {
- set_pev(id, pev_viewmodel2, v_model)
- set_weapon_anim(id, 2)
- set_nextattack(ent, id, 1.0)
- } else {
- set_pev(id, pev_viewmodel2, v_model)
- set_weapon_anim(id, 2)
- set_nextattack(ent, id, 1.0)
- remove_task(id)
- reset_player_maxspeed(id)
- }
- }
- }
- if(anim == 0)
- {
- if(g_skull3_mode[id] == 1)
- {
- cs_set_user_bpammo(id, CSW_SKULL3_M2, cs_get_user_bpammo(id, CSW_SKULL3_M1))
- g_skull3_ammo[id] = cs_get_user_bpammo(id, CSW_SKULL3_M2)
- } else if(g_skull3_mode[id] == 2) {
- cs_set_user_bpammo(id, CSW_SKULL3_M1, cs_get_user_bpammo(id, CSW_SKULL3_M2))
- g_skull3_ammo[id] = cs_get_user_bpammo(id, CSW_SKULL3_M1)
- }
- }
- }
- return HAM_HANDLED
- }
- public ham_anim_skull3_m2(ent, anim, skiplocal, body)
- {
- if(!pev_valid(ent))
- return HAM_IGNORED
- static id
- id = pev(ent, pev_owner)
- if(is_user_alive(id) && is_user_connected(id) && g_had_skull3[id])
- {
- if(anim == 2)
- {
- if(g_skull3_mode[id] == 1)
- {
- g_skull3_changing[id] = 1
- set_pev(id, pev_viewmodel2, v_model2)
- set_weapon_anim(id, 6)
- set_pdata_int(id, 83, 3, 5)
- set_task(3.0, "change_complete2", id)
- set_nextattack(ent, id, 3.0)
- //event_checkweapon(id)
- if(pev(id, pev_maxspeed) != get_pcvar_float(cvar_decrease_speed))
- set_user_maxspeed(id, get_pcvar_float(cvar_decrease_speed))
- } else if(g_skull3_mode[id] == 2) {
- set_pev(id, pev_viewmodel2, v_model2)
- set_weapon_anim(id, 2)
- set_nextattack(ent, id, 1.0)
- }
- }
- if(anim == 0)
- {
- if(g_skull3_mode[id] == 1)
- {
- cs_set_user_bpammo(id, CSW_SKULL3_M2, cs_get_user_bpammo(id, CSW_SKULL3_M1))
- g_skull3_ammo[id] = cs_get_user_bpammo(id, CSW_SKULL3_M2)
- } else if(g_skull3_mode[id] == 2) {
- cs_set_user_bpammo(id, CSW_SKULL3_M1, cs_get_user_bpammo(id, CSW_SKULL3_M2))
- g_skull3_ammo[id] = cs_get_user_bpammo(id, CSW_SKULL3_M1)
- }
- }
- }
- return HAM_HANDLED
- }
- public fw_Ham_Item_Deploy_Post(ent)
- {
- if(!pev_valid(ent))
- return HAM_IGNORED
- static id
- id = pev(ent, pev_owner)
- if(is_user_alive(id) && is_user_connected(id))
- {
- if(pev(id, pev_maxspeed) == get_pcvar_float(cvar_decrease_speed))
- reset_player_maxspeed(id)
- }
- return HAM_HANDLED
- }
- public ham_deploy_skull3_m1(ent)
- {
- if(!pev_valid(ent))
- return HAM_IGNORED
- static id
- id = pev(ent, pev_owner)
- if(is_user_alive(id) && is_user_connected(id) && g_had_skull3[id] && g_skull3_changing[id])
- {
- set_nextattack(ent, id, 3.0)
- }
- return HAM_HANDLED
- }
- public ham_deploy_skull3_m2(ent)
- {
- if(!pev_valid(ent))
- return HAM_IGNORED
- static id
- id = pev(ent, pev_owner)
- if(is_user_alive(id) && is_user_connected(id) && g_had_skull3[id] && g_skull3_changing[id])
- {
- set_nextattack(ent, id, 3.0)
- }
- return HAM_HANDLED
- }
- public ham_attack_skull3(ent)
- {
- if(!pev_valid(ent))
- return HAM_IGNORED
- static id
- id = pev(ent, pev_owner)
- if(is_user_alive(id) && is_user_connected(id) && g_had_skull3[id])
- {
- g_is_attacking[id] = 1
- pev(id, pev_punchangle, g_recoil[id])
- }
- return HAM_HANDLED
- }
- public ham_attack_skull3_post(ent)
- {
- if(!pev_valid(ent))
- return HAM_IGNORED
- static id
- id = pev(ent, pev_owner)
- if(is_user_alive(id) && is_user_connected(id) && g_had_skull3[id])
- {
- g_is_attacking[id] = 0
- new Float:static_recoil[3]
- pev(id, pev_punchangle, static_recoil)
- xs_vec_sub(static_recoil, g_recoil[id], static_recoil)
- if(g_skull3_mode[id] == 1)
- xs_vec_mul_scalar(static_recoil, get_pcvar_float(cvar_recoil_m1), static_recoil)
- else if(g_skull3_mode[id] == 2)
- xs_vec_mul_scalar(static_recoil, get_pcvar_float(cvar_recoil_m2), static_recoil)
- xs_vec_add(static_recoil, g_recoil[id], static_recoil)
- set_pev(id, pev_punchangle, static_recoil)
- if (!cs_get_weapon_ammo(ent))
- return HAM_IGNORED
- emit_sound(id, CHAN_WEAPON, skull3_sound[0], VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
- if(g_skull3_mode[id] == 1)
- {
- set_weapon_anim(id, 3)
- } else if(g_skull3_mode[id] == 2) {
- set_pdata_float(ent, 62, 0.4, 4)
- if(g_shot_anim[id] == 0)
- {
- set_weapon_anim(id, 3)
- g_shot_anim[id] = 1
- } else if(g_shot_anim[id] == 1) {
- set_weapon_anim(id, 5)
- g_shot_anim[id] = 0
- }
- }
- }
- return HAM_HANDLED
- }
- public ham_reload_skull3(ent)
- {
- if(!pev_valid(ent))
- return HAM_IGNORED
- static id
- id = pev(ent, pev_owner)
- if(is_user_alive(id) && is_user_connected(id) && g_had_skull3[id])
- {
- g_skull3_clip[id] = -1
- new bpammo
- if(g_skull3_mode[id] == 1)
- bpammo = cs_get_user_bpammo(id, CSW_SKULL3_M1)
- else if(g_skull3_mode[id] == 2)
- bpammo = cs_get_user_bpammo(id, CSW_SKULL3_M2)
- new iClip = get_pdata_int(ent, 51, 4)
- if (bpammo <= 0)
- return HAM_SUPERCEDE
- if(g_skull3_mode[id] == 1)
- {
- if(iClip >= get_pcvar_num(cvar_clip_m1))
- return HAM_SUPERCEDE
- } else if(g_skull3_mode[id] == 2) {
- if(iClip >= get_pcvar_num(cvar_clip_m2))
- return HAM_SUPERCEDE
- }
- g_skull3_clip[id] = iClip
- g_reload[id] = 1
- }
- return HAM_IGNORED
- }
- public ham_reload_skull3_post(ent)
- {
- if(!pev_valid(ent))
- return HAM_IGNORED
- static id
- id = pev(ent, pev_owner)
- if(is_user_alive(id) && is_user_connected(id) && g_had_skull3[id])
- {
- if (g_skull3_clip[id] == -1)
- return HAM_IGNORED
- static Float:reload_time
- if(g_skull3_mode[id] == 1)
- reload_time = 2.2
- else if(g_skull3_mode[id] == 2)
- reload_time = 3.4
- set_pdata_int(ent, 51, g_skull3_clip[id], 4)
- set_pdata_float(ent, 48, reload_time, 4)
- set_pdata_float(id, 83, reload_time, 5)
- set_pdata_int(ent, 54, 1, 4)
- set_weapon_anim(id, 1)
- }
- return HAM_IGNORED
- }
- public ham_postframe_skull3(ent)
- {
- if(!pev_valid(ent))
- return HAM_IGNORED
- static id
- id = pev(ent, pev_owner)
- if(is_user_alive(id) && is_user_connected(id) && g_had_skull3[id])
- {
- new Float:flNextAttack = get_pdata_float(id, 83, 5)
- new bpammo
- if(g_skull3_mode[id] == 1)
- bpammo = cs_get_user_bpammo(id, CSW_SKULL3_M1)
- else if(g_skull3_mode[id] == 2)
- bpammo = cs_get_user_bpammo(id, CSW_SKULL3_M2)
- new iClip = get_pdata_int(ent, 51, 4)
- new fInReload = get_pdata_int(ent, 54, 4)
- if(fInReload && flNextAttack <= 0.0)
- {
- new temp1
- if(g_skull3_mode[id] == 1)
- {
- temp1 = min(get_pcvar_num(cvar_clip_m1) - iClip, bpammo)
- } else if(g_skull3_mode[id] == 2) {
- temp1 = min(get_pcvar_num(cvar_clip_m2) - iClip, bpammo)
- }
- set_pdata_int(ent, 51, iClip + temp1, 4)
- if(g_skull3_mode[id] == 1)
- cs_set_user_bpammo(id, CSW_SKULL3_M1, bpammo-temp1)
- else if(g_skull3_mode[id] == 2)
- cs_set_user_bpammo(id, CSW_SKULL3_M2, bpammo-temp1)
- set_pdata_int(ent, 54, 0, 4)
- fInReload = 0
- g_reload[id] = 0
- }
- }
- return HAM_IGNORED
- }
- public ham_takedamage_player(victim, inflictor, attacker, Float:damage, damagebits)
- {
- if(!is_user_alive(victim) || !is_user_connected(victim))
- return HAM_IGNORED
- if(!is_user_alive(attacker) || !is_user_connected(attacker))
- return HAM_IGNORED
- if(ze_is_user_zombie(attacker))
- return HAM_IGNORED
- if(!g_had_skull3[attacker])
- return HAM_IGNORED
- if(get_user_weapon(attacker) == CSW_SKULL3_M1 && g_skull3_mode[attacker] == 1)
- {
- SetHamParamFloat(4, damage * get_pcvar_float(cvar_damage_m1))
- } else if(get_user_weapon(attacker) == CSW_SKULL3_M2 && g_skull3_mode[attacker] == 2) {
- SetHamParamFloat(4, damage * get_pcvar_float(cvar_damage_m2))
- }
- return HAM_HANDLED
- }
- public client_PostThink(id)
- {
- if(!is_user_alive(id) || !is_user_connected(id))
- return
- if(ze_is_user_zombie(id))
- return
- if(!g_had_skull3[id])
- return
- if(get_user_weapon(id) != CSW_SKULL3_M2 || g_skull3_mode[id] != 2)
- return
- if(pev(id, pev_maxspeed) != get_pcvar_float(cvar_decrease_speed))
- set_user_maxspeed(id, get_pcvar_float(cvar_decrease_speed))
- }
- public change_complete1(id)
- {
- g_skull3_changing[id] = 0
- if(get_user_weapon(id) == CSW_SKULL3_M1 && g_had_skull3[id])
- g_skull3_mode[id] = 1
- }
- public change_complete2(id)
- {
- g_skull3_changing[id] = 0
- if(get_user_weapon(id) == CSW_SKULL3_M2 && g_had_skull3[id])
- g_skull3_mode[id] = 2
- }
- stock set_weapon_anim(id, anim)
- {
- set_pev(id, pev_weaponanim, anim)
- message_begin(MSG_ONE, SVC_WEAPONANIM, _, id)
- write_byte(anim)
- write_byte(pev(id, pev_body))
- message_end()
- }
- stock set_nextattack(const weapon, const player, const Float:nextTime)
- {
- const m_flNextPrimaryAttack = 46
- const m_flNextSecondaryAttack = 47
- const m_flTimeWeaponIdle = 48
- const m_flNextAttack = 83
- set_pdata_float(weapon, m_flNextPrimaryAttack , nextTime, 4)
- set_pdata_float(weapon, m_flNextSecondaryAttack, nextTime, 4)
- set_pdata_float(weapon, m_flTimeWeaponIdle, nextTime, 4)
- set_pdata_float(player, m_flNextAttack, nextTime, 5)
- }
- stock make_bullet(id, Float:Origin[3])
- {
- // Find target
- new target, body
- get_user_aiming(id, target, body, 999999)
- if(target > 0 && target <= get_maxplayers())
- {
- new Float:fStart[3], Float:fEnd[3], Float:fRes[3], Float:fVel[3]
- pev(id, pev_origin, fStart)
- // Get ids view direction
- velocity_by_aim(id, 64, fVel)
- // Calculate position where blood should be displayed
- fStart[0] = Origin[0]
- fStart[1] = Origin[1]
- fStart[2] = Origin[2]
- fEnd[0] = fStart[0]+fVel[0]
- fEnd[1] = fStart[1]+fVel[1]
- fEnd[2] = fStart[2]+fVel[2]
- // Draw traceline from victims origin into ids view direction to find
- // the location on the wall to put some blood on there
- new res
- engfunc(EngFunc_TraceLine, fStart, fEnd, 0, target, res)
- get_tr2(res, TR_vecEndPos, fRes)
- // Show some blood :)
- message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
- write_byte(TE_BLOODSPRITE)
- write_coord(floatround(fStart[0]))
- write_coord(floatround(fStart[1]))
- write_coord(floatround(fStart[2]))
- write_short(g_bloodspray)
- write_short(g_blood)
- write_byte(70)
- write_byte(random_num(1,2))
- message_end()
- } else {
- new decal = 41
- // Check if the wall hit is an entity
- if(target)
- {
- // Put decal on an entity
- message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
- write_byte(TE_DECAL)
- write_coord(floatround(Origin[0]))
- write_coord(floatround(Origin[1]))
- write_coord(floatround(Origin[2]))
- write_byte(decal)
- write_short(target)
- message_end()
- } else {
- // Put decal on "world" (a wall)
- message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
- write_byte(TE_WORLDDECAL)
- write_coord(floatround(Origin[0]))
- write_coord(floatround(Origin[1]))
- write_coord(floatround(Origin[2]))
- write_byte(decal)
- message_end()
- }
- // Show sparcles
- message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
- write_byte(TE_GUNSHOTDECAL)
- write_coord(floatround(Origin[0]))
- write_coord(floatround(Origin[1]))
- write_coord(floatround(Origin[2]))
- write_short(id)
- write_byte(decal)
- message_end()
- }
- }
- stock drop_weapons(id, dropwhat)
- {
- static weapons[32], num, i, weaponid
- num = 0
- get_user_weapons(id, weapons, num)
- 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, sizeof wname - 1)
- engclient_cmd(id, "drop", wname)
- }
- }
- }
- stock ham_strip_weapon(id, weapon[])
- {
- if(!equal(weapon,"weapon_",7))
- return 0
- new wId = get_weaponid(weapon);
- if(!wId)
- return 0;
- new wEnt;
- while((wEnt = engfunc(EngFunc_FindEntityByString,wEnt,"classname",weapon)) && pev(wEnt,pev_owner) != id) {}
- if(!wEnt)
- return 0;
- if(get_user_weapon(id) == wId) ExecuteHamB(Ham_Weapon_RetireWeapon,wEnt);
- if(!ExecuteHamB(Ham_RemovePlayerItem,id,wEnt))
- return 0;
- ExecuteHamB(Ham_Item_Kill,wEnt);
- set_pev(id,pev_weapons,pev(id,pev_weapons) & ~(1<<wId));
- return 1
- }
- stock reset_player_maxspeed(id)
- {
- if(!is_user_alive(id))
- return
- set_user_maxspeed(id, g_oldspeed[id])
- }
I'am not going to Compile this one as you need to update your hamsandwich module to work. I only need to learn you how to convert only this is my point.