Raised This Month: $ Target: $400
 0% 

Error:Failed to load dialog file Resource/UI/ClassMenu.res


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Swedish Chef
Junior Member
Join Date: Sep 2006
Old 09-28-2006 , 20:22   Error:Failed to load dialog file Resource/UI/ClassMenu.res
Reply With Quote #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
Swedish Chef is offline
 


Thread Tools
Display Modes

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

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

Forum Jump


All times are GMT -4. The time now is 04:48.


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