Raised This Month: $ Target: $400
 0% 

Shows weapons from every player when it shouldnt


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
RULEEwasdsa
Junior Member
Join Date: Dec 2008
Old 12-19-2008 , 21:04   Shows weapons from every player when it shouldnt
Reply With Quote #1

when you are carryin a weapon, it says the name correctly, but when any other player reloads, i see in my screen the msg Reloading[the other guy weapon] when that shouldnt be there.


Code:
#include <amxmodx>
#include <amxmisc>
#include <engine>

#define PLUGIN "Simple Weapon Info"
#define VERSION "1.0"
#define AUTHOR "[L]ambert."

new HUDSYNC
new wpname[32]
new bool:reload[33] = false



public plugin_init() {
    register_plugin(PLUGIN, VERSION, AUTHOR)
    HUDSYNC = CreateHudSyncObj();
    register_event("CurWeapon", "RegisWeapon", "be", "1=1")
    
}

public RegisWeapon(id){
    
    new weapon = get_user_weapon(id)
    
    
    switch(weapon) 
    {
        case CSW_P228: 
        wpname = "p228"
        case CSW_SCOUT: 
        wpname = "pinche"
        case CSW_XM1014:
        wpname = "XM1014"
        case CSW_MAC10: 
        wpname = "mac10"
        case CSW_AUG: 
        wpname = "AUG"
        case CSW_ELITE: 
        wpname = "Dual"
        case CSW_FIVESEVEN: 
        wpname = "Fiveseven"
        case CSW_UMP45: 
        wpname = "ump45"
        case CSW_SG550: 
        wpname = "sg550"
        case CSW_GALIL: 
        wpname = "Galil"
        case CSW_FAMAS: 
        wpname = "Famas"
        case CSW_USP: 
        wpname = "Usp"
        case CSW_MP5NAVY: 
        wpname = "mp5"
        case CSW_M249: 
        wpname = "m249"
        case CSW_M3: 
        wpname = "m3"
        case CSW_M4A1: 
        wpname = "Colt"
        case CSW_TMP: 
        wpname = "Tmp"
        case CSW_G3SG1: 
        wpname = "Repe"
        case CSW_DEAGLE: 
        wpname = "Desert"
        case CSW_SG552: 
        wpname = "sg552"
        case CSW_AK47: 
        wpname = "ak47"
        case CSW_KNIFE: 
        wpname = "Cuchi"
        case CSW_P90: 
        wpname = "p90"
        case CSW_GLOCK18: 
        wpname = "Glock"
        case CSW_AWP: 
        wpname = "Awp"
        default: 
        return
    }
    
    show_msg(id)
    
    return
    
    
}

public client_PreThink(id){
    
    new ammo
    new clip
    new weapon = get_user_weapon(id,clip,ammo)
    
    if(weapon != CSW_KNIFE){
        
        if(clip == 0 && ammo > 0){
            show_remsg(id)
        }
        else if(clip == 0 && ammo == 0){
            show_empty(id)
        }
        if(get_user_button(id) & IN_RELOAD && reload[id] == false){
            
            reload[id] = true
            show_remsg(id)
            
        }
    }
    
}

public show_msg(id){
    set_hudmessage(0, 255, 0, 0.95, 0.0, 0, 6.0, 12.0)
    ShowSyncHudMsg(id, HUDSYNC, "%s", wpname)
    
}

public show_remsg(id){
    set_hudmessage(0, 255, 0, 0.95, 0.0, 0, 6.0, 12.0)
    ShowSyncHudMsg(id, HUDSYNC, "[Reloading] %s", wpname)
    reload[id] = false
}

public show_empty(id){
    set_hudmessage(0, 255, 0, 0.95, 0.0, 0, 6.0, 12.0)
    ShowSyncHudMsg(id, HUDSYNC, "[Empty] %s", wpname)
}

Last edited by RULEEwasdsa; 12-19-2008 at 21:07.
RULEEwasdsa is offline
 



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 09:14.


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