Raised This Month: $ Target: $400
 0% 

Shows weapons from every player when it shouldnt


Post New Thread Reply   
 
Thread Tools Display Modes
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
Starsailor
horrible hahah
Join Date: Aug 2008
Location: Buenos Aires
Old 12-19-2008 , 21:35   Re: Shows weapons from every player when it shouldnt
Reply With Quote #2

who is lambert?
__________________
Find my plugins here..

Ex - Spanish Moderator.
Starsailor is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 12-19-2008 , 21:41   Re: Shows weapons from every player when it shouldnt
Reply With Quote #3

Use the clear hud function that goes with the hud sync you are using before you show the message.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
RULEEwasdsa
Junior Member
Join Date: Dec 2008
Old 12-19-2008 , 22:31   Re: Shows weapons from every player when it shouldnt
Reply With Quote #4

Quote:
Originally Posted by Starsailor View Post
who is lambert?
i am ¬¬ martin , ya sabes que soi yo (you know that)
RULEEwasdsa is offline
Starsailor
horrible hahah
Join Date: Aug 2008
Location: Buenos Aires
Old 12-19-2008 , 22:39   Re: Shows weapons from every player when it shouldnt
Reply With Quote #5

Quote:
Originally Posted by Exolent[jNr] View Post
Use the clear hud function that goes with the hud sync you are using before you show the message.

can you give an example code?
__________________
Find my plugins here..

Ex - Spanish Moderator.
Starsailor is offline
RULEEwasdsa
Junior Member
Join Date: Dec 2008
Old 12-19-2008 , 22:55   Re: Shows weapons from every player when it shouldnt
Reply With Quote #6

like this ?
Code:
public show_msg(id){
    ClearSyncHud(id, HUDSYNC)
    set_hudmessage(0, 255, 0, 0.95, 0.0, 0, 6.0, 12.0)
    ShowSyncHudMsg(id, HUDSYNC, "%s", wpname)
    
}
if this is the correct code, it doesnt work :S
RULEEwasdsa is offline
Old 12-19-2008, 23:04
Starsailor
This message has been deleted by Starsailor. Reason: :)
Reply



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 18:30.


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