Raised This Month: $51 Target: $400
 12% 

Solved custom weapon hud problems


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
man_s_our
Senior Member
Join Date: Jul 2017
Location: aim_taliban
Old 04-06-2018 , 07:58   custom weapon hud problems
Reply With Quote #1

when I use this code and try to switch to m3 it doesn't switch.
what's the error I made?
PHP Code:
#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>
public plugin_init ()
{
     
RegisterHam(Ham_Item_AddToPlayer"weapon_m3" "Fw_Item_AddToPlayer_Post"1);
}
public 
Fw_Item_AddToPlayer_Post(weaponid)
{
    if(!
pev_valid(weapon))
        return 
HAM_IGNORED

    message_begin
(MSG_ONEget_user_msgid("WeaponList"), .player id);
    
write_string("weapon_xm1014");     // WeaponName  
    
write_byte(5);    // PrimaryAmmoID  
    
write_byte(5);        // PrimaryAmmoMaxAmount  
    
write_byte(-1);            // SecondaryAmmoID  
    
write_byte(-1);            // SecondaryAmmoMaxAmount  
    
write_byte(0);        // SlotID (0...N)  
    
write_byte(5);    // NumberInSlot (1...N)  
    
write_byte(CSW_M3);      // WeaponID  
    
write_byte(0);        // Flags  
    
message_end();
    return 
HAM_HANDLED    

__________________

Last edited by man_s_our; 04-06-2018 at 12:56.
man_s_our is offline
man_s_our
Senior Member
Join Date: Jul 2017
Location: aim_taliban
Old 04-06-2018 , 12:55   Re: custom weapon hud problems
Reply With Quote #2

Quote:
Originally Posted by Arkshine View Post
Custom Weapon Hud Sprites + Slot Redirection
The first argument is used for example when you select a weapon, it's the same as entering in the console the weapon name.
It's there you change it by your new weapon name, like weapon_flare.
To select the weapon, you will need to hook this weapon name in order to redirect it to the original weapon.
__________________

Last edited by man_s_our; 04-06-2018 at 12:56.
man_s_our is offline
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 15:38.


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