|
Junior Member
|

09-28-2006
, 20:22
Error:Failed to load dialog file Resource/UI/ClassMenu.res
|
#1
|
hello everyone,
sry for any inconvinience in advance, but im having a problem with an idea i came up with:
I changed the "brass knuckles" plugin so that it would work with another "knife skin" called "kung fu". Everything worked fine until alot of the people that tries to connect to my server get disconnected and their CS quits! I noticed this only after Counter-Strikes update 2 or 3 weeks ago, im not sure that it's related tho...
here's the original code for the plugin:
Code:
#include <amxmodx>
#include <fakemeta>
#include <engine>
#include <cstrike>
new PLUGIN_NAME[] = "Brass Knuckles"
new PLUGIN_VERSION[] = "1.0"
new PLUGIN_AUTHOR[] = "Cheap_Suit"
public plugin_init()
{
register_plugin(PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR)
register_event("CurWeapon", "Event_CurWeapon", "be", "1=1")
register_event("Damage", "Event_Damage", "be", "2!0")
register_forward(FM_EmitSound, "EmitSound")
}
public plugin_precache()
{
precache_model("models/p_bknuckles.mdl")
precache_model("models/v_bknuckles.mdl")
precache_sound("bknuckles/knife_hit1.wav")
precache_sound("bknuckles/knife_hit2.wav")
precache_sound("bknuckles/knife_hit3.wav")
precache_sound("bknuckles/knife_hit4.wav")
precache_sound("bknuckles/knife_stab.wav")
}
public Event_Damage(id)
{
if(!is_user_alive(id) || !is_user_connected(id))
return PLUGIN_CONTINUE
new AttakerWeapon, AttakerPartHit
get_user_attacker(id, AttakerWeapon, AttakerPartHit)
if(AttakerWeapon != CSW_KNIFE)
return PLUGIN_CONTINUE
new Float:Random_Float[3]
for(new i = 0; i < 3; i++) Random_Float[i] = random_float(100.0, 150.0)
Punch_View(id, Random_Float)
return PLUGIN_CONTINUE
}
public Event_CurWeapon(id)
{
if(!is_user_alive(id) || !is_user_connected(id))
return PLUGIN_CONTINUE
new temp[2], weapon = get_user_weapon(id, temp[0], temp[1])
if(weapon == CSW_KNIFE)
{
entity_set_string(id, EV_SZ_viewmodel, "models/v_bknuckles.mdl")
entity_set_string(id, EV_SZ_weaponmodel, "models/p_bknuckles.mdl")
}
return PLUGIN_CONTINUE
}
public EmitSound(id, channel, sample[])
{
if(!is_user_alive(id) || !is_user_connected(id))
return FMRES_IGNORED
new temp[2], weapon = get_user_weapon(id, temp[0], temp[1])
if(weapon == CSW_KNIFE)
{
if(equal(sample,"weapons/knife_hit1.wav"))
{
emit_sound(id, CHAN_WEAPON, "bknuckles/knife_hit1.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)
return FMRES_SUPERCEDE
}
else if(equal(sample,"weapons/knife_hit2.wav"))
{
emit_sound(id, CHAN_WEAPON, "bknuckles/knife_hit2.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)
return FMRES_SUPERCEDE
}
else if(equal(sample,"weapons/knife_hit3.wav"))
{
emit_sound(id, CHAN_WEAPON, "bknuckles/knife_hit3.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)
return FMRES_SUPERCEDE
}
else if(equal(sample,"weapons/knife_hit4.wav"))
{
emit_sound(id, CHAN_WEAPON, "bknuckles/knife_hit4.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)
return FMRES_SUPERCEDE
}
else if(equal(sample,"weapons/knife_stab.wav"))
{
emit_sound(id, CHAN_WEAPON, "bknuckles/knife_stab.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)
return FMRES_SUPERCEDE
}
}
return FMRES_IGNORED
}
stock Punch_View(id, Float:ViewAngle[3])
{
entity_set_vector(id, EV_VEC_punchangle, ViewAngle)
}
Here's the plugin after i changed it:
Code:
#include <amxmodx>
#include <fakemeta>
#include <engine>
#include <cstrike>
new PLUGIN_NAME[] =
new PLUGIN_VERSION[] =
new PLUGIN_AUTHOR[] =
public plugin_init()
{
register_plugin(PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR)
register_event("CurWeapon", "Event_CurWeapon", "be", "1=1")
register_event("Damage", "Event_Damage", "be", "2!0")
register_forward(FM_EmitSound, "EmitSound")
}
public plugin_precache()
{
precache_model("models/v_tgf_kungfu.mdl")
precache_model("models/p_tgf_kungfu.mdl")
precache_sound("tgf/tgf_hit1.wav")
precache_sound("tgf/tgf_hit2.wav")
precache_sound("tgf/tgf_hit3.wav")
precache_sound("tgf/tgf_hit4.wav")
precache_sound("tgf/tgf_deploy1.wav")
precache_sound("tgf/tgf_hitwall1.wav")
precache_sound("tgf/tgf_slash1.wav")
precache_sound("tgf/tgf_slash2.wav")
precache_sound("tgf/tgf_stab.wav")
}
public Event_Damage(id)
{
if(!is_user_alive(id) || !is_user_connected(id))
return PLUGIN_CONTINUE
new AttakerWeapon, AttakerPartHit
get_user_attacker(id, AttakerWeapon, AttakerPartHit)
if(AttakerWeapon != CSW_KNIFE)
return PLUGIN_CONTINUE
new Float:Random_Float[3]
for(new i = 0; i < 3; i++) Random_Float[i] = random_float(100.0, 150.0)
Punch_View(id, Random_Float)
return PLUGIN_CONTINUE
}
public Event_CurWeapon(id)
{
if(!is_user_alive(id) || !is_user_connected(id))
return PLUGIN_CONTINUE
new temp[2], weapon = get_user_weapon(id, temp[0], temp[1])
if(weapon == CSW_KNIFE)
{
entity_set_string(id, EV_SZ_viewmodel, "models/v_tgf_kungfu.mdl")
entity_set_string(id, EV_SZ_weaponmodel, "models/p_tgf_kungfu.mdl")
}
return PLUGIN_CONTINUE
}
public EmitSound(id, channel, sample[])
{
if(!is_user_alive(id) || !is_user_connected(id))
return FMRES_IGNORED
new temp[2], weapon = get_user_weapon(id, temp[0], temp[1])
if(weapon == CSW_KNIFE)
{
if(equal(sample,"weapons/knife_hit1.wav"))
{
emit_sound(id, CHAN_WEAPON, "tgf/tgf_hit1.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)
return FMRES_SUPERCEDE
}
else if(equal(sample,"weapons/knife_hit2.wav"))
{
emit_sound(id, CHAN_WEAPON, "tgf/tgf_hit2.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)
return FMRES_SUPERCEDE
}
else if(equal(sample,"weapons/knife_hit3.wav"))
{
emit_sound(id, CHAN_WEAPON, "tgf/tgf_hit3.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)
return FMRES_SUPERCEDE
}
else if(equal(sample,"weapons/knife_hit4.wav"))
{
emit_sound(id, CHAN_WEAPON, "tgf/tgf_hit4.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)
return FMRES_SUPERCEDE
}
else if(equal(sample,"weapons/knife_stab.wav"))
{
emit_sound(id, CHAN_WEAPON, "tgf/tgf_stab.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)
return FMRES_SUPERCEDE
}
else if(equal(sample,"weapons/knife_deploy1.wav"))
{
emit_sound(id, CHAN_WEAPON, "tgf/tgf_deploy1.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)
return FMRES_SUPERCEDE
}
else if(equal(sample,"weapons/knife_hitwall1.wav"))
{
emit_sound(id, CHAN_WEAPON, "tgf/tgf_hitwall1.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)
return FMRES_SUPERCEDE
}
else if(equal(sample,"weapons/knife_slash1.wav"))
{
emit_sound(id, CHAN_WEAPON, "tgf/tgf_slash1.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)
return FMRES_SUPERCEDE
}
else if(equal(sample,"weapons/knife_slash2.wav"))
{
emit_sound(id, CHAN_WEAPON, "tgf/tgf_slash2.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)
return FMRES_SUPERCEDE
}
}
return FMRES_IGNORED
}
stock Punch_View(id, Float:ViewAngle[3])
{
entity_set_vector(id, EV_VEC_punchangle, ViewAngle)
}
all sounds and models are in the right folders and the necessary modules are enabled.
The error logged in CS when people get disconnected/CS quits is
Code:
Error:Failed to load dialog file Resource/UI/ClassMenu.res
Function trace:
CFileSystem_Steam::Mount()
Thank you for any help provided in advance.
Sorry if the code is not written properly, but its the first time i've done anything like this...
Last edited by Swedish Chef; 09-29-2006 at 15:04.
Reason: better title
|
|