Raised This Month: $ Target: $400
 0% 

plugin like in the picture


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
WATCH_D0GS UNITED
Senior Member
Join Date: Jan 2023
Old 12-22-2023 , 18:57   Re: plugin like in the picture
Reply With Quote #1

Something you can do, is:

Create or find a variable which stores the selected weapon slot;

Hook the moment the slot is select (user clicks), which is before Ham_Item_Deploy;

In Ham_Item_Deploy, check that variable:

PHP Code:
public Item_Deploy_Post(const ent) {
        new 
id get_pdata_cbase(ent,41)
        new 
wpn get_pdata_int(ent,43)
        if(
wpn == certain_weapon) {
                switch(
weapon_slot) {
                        case 
1set_pev(id,pev_viewmodel2,mdl_a)
                        case 
2set_pev(id,pev_viewmodel2,mdl_b)
                        default: return 
HAM_IGNORED
                
}
                return 
HAM_IGNORED
        
}
        return 
HAM_IGNORED

__________________
💻Know Our New Blog👄
🔗tube2downs.blogspot.com
WATCH_D0GS UNITED is offline
Hakim Azizov
Member
Join Date: Mar 2023
Old 12-24-2023 , 07:46   Re: plugin like in the picture
Reply With Quote #2

Quote:
Originally Posted by WATCH_D0GS UNITED View Post
Something you can do, is:

Create or find a variable which stores the selected weapon slot;

Hook the moment the slot is select (user clicks), which is before Ham_Item_Deploy;

In Ham_Item_Deploy, check that variable:

PHP Code:
public Item_Deploy_Post(const ent) {
        new 
id get_pdata_cbase(ent,41)
        new 
wpn get_pdata_int(ent,43)
        if(
wpn == certain_weapon) {
                switch(
weapon_slot) {
                        case 
1set_pev(id,pev_viewmodel2,mdl_a)
                        case 
2set_pev(id,pev_viewmodel2,mdl_b)
                        default: return 
HAM_IGNORED
                
}
                return 
HAM_IGNORED
        
}
        return 
HAM_IGNORED

hmm, this looks like difficult, if i can get weapons' slot key with .sma, i can do
Hakim Azizov 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 00:32.


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