Raised This Month: $ Target: $400
 0% 

plugin like in the picture


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Hakim Azizov
Member
Join Date: Mar 2023
Old 12-22-2023 , 14:58   plugin like in the picture
Reply With Quote #1

hello everyone. I have posted to the forum about this issue in the past, but my plugin in that code did not fully work for me, but I would like to thank those who helped me.

I want an add-on like in the picture, when the player chooses the 2nd AK 47, I want it to give her a special weapon skin.

Image: https://forums.alliedmods.net/attach...1&d=1703275001
Attached Thumbnails
Click image for larger version

Name:	this_is_bullshit.jpg
Views:	98
Size:	23.3 KB
ID:	202581  
Hakim Azizov is offline
WATCH_D0GS UNITED
Senior Member
Join Date: Jan 2023
Old 12-22-2023 , 16:04   Re: plugin like in the picture
Reply With Quote #2

Are you talking about this plugin: https://forums.alliedmods.net/showthread.php?t=343890
?
__________________
💻Know Our New Blog👄
🔗tube2downs.blogspot.com
WATCH_D0GS UNITED is offline
Hakim Azizov
Member
Join Date: Mar 2023
Old 12-22-2023 , 16:41   Re: plugin like in the picture
Reply With Quote #3

Quote:
Originally Posted by WATCH_D0GS UNITED View Post
Are you talking about this plugin: https://forums.alliedmods.net/showthread.php?t=343890
?
I tried this, but it didn't work for me. Even though it's similar to what I want, it's different
Hakim Azizov is offline
WATCH_D0GS UNITED
Senior Member
Join Date: Jan 2023
Old 12-22-2023 , 18:57   Re: plugin like in the picture
Reply With Quote #4

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 #5

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
Jhob94
AMX Mod X Donor
Join Date: Jul 2012
Old 12-24-2023 , 08:53   Re: plugin like in the picture
Reply With Quote #6

That picture is fake. If you zoom you can see it’s a copy/paste from the first. It’s possible to make the c4 have the ak sprite. But yeah, my virtual weapons slots is the best solution right now.
__________________
Jhob94 is offline
Hakim Azizov
Member
Join Date: Mar 2023
Old 12-24-2023 , 11:23   Re: plugin like in the picture
Reply With Quote #7

Quote:
Originally Posted by Jhob94 View Post
That picture is fake. If you zoom you can see it’s a copy/paste from the first. It’s possible to make the c4 have the ak sprite. But yeah, my virtual weapons slots is the best solution right now.
Bro, I know that the picture I shared is fake. I posted this picture so you can understand what I want. Your Virtual Weapon Slot plugin worked partially, it would be great if you could do this with the buttons used to select weapons (Buttons: 1, 2). For example, when you press 1 - (First weapon slot), the menu in your Virtual Weapon Slot add-on will appear.
Hakim Azizov is offline
Jhob94
AMX Mod X Donor
Join Date: Jul 2012
Old 12-24-2023 , 13:43   Re: plugin like in the picture
Reply With Quote #8

Look, that’s pretty much impossible.
It is kinda possible but it’s just too much effort for the work.
Instead of doing this why don’t you try to change the weapon of the plugin?
Instead of using AK use another one like galil. Most of zombie plugins already change reload time, ammo and sounds so changing the weapon could be a more simple solution for you.
__________________
Jhob94 is offline
WATCH_D0GS UNITED
Senior Member
Join Date: Jan 2023
Old 12-24-2023 , 17:25   Re: plugin like in the picture
Reply With Quote #9

@Hakim Azizov

We've made this edit in the virtual_weapon_slots.sma code which will allow you to select two weapon skins.

Open the script and rename "models/v_galil.mdl" to the special skin .mdl you want to apply.

Note that you have to press 'F' and select your desired skin.

The Player weapon skin/slot is saved in a variable so it will work perfectly when switching weapons*.

Download:
Attached Files
File Type: sma Get Plugin or Get Source (virtual_weapon_slots.sma - 21 views - 6.9 KB)
__________________
💻Know Our New Blog👄
🔗tube2downs.blogspot.com
WATCH_D0GS UNITED is offline
Hakim Azizov
Member
Join Date: Mar 2023
Old 12-25-2023 , 09:55   Re: plugin like in the picture
Reply With Quote #10

Quote:
Originally Posted by Jhob94 View Post
Look, that’s pretty much impossible.
It is kinda possible but it’s just too much effort for the work.
Instead of doing this why don’t you try to change the weapon of the plugin?
Instead of using AK use another one like galil. Most of zombie plugins already change reload time, ammo and sounds so changing the weapon could be a more simple solution for you.
bro, CSW_ changing the weapon names will not be of much use since the number of weapons is low. For example, I want to give a guillotine to admins, and there will also be a knife skin for the admin. Unfortunately, since these two use the same slot, only one of their skins will appear. Even if it is not possible to do this, it is okay. (I am grateful for your help.) I will recreate the codes of the game (.dll) using Assembly coding language by Reverse Engineering. Then, I will ensure that these codes are sent to the players connecting to my server. Even if it's illegal, I need it. Thus, many problems will be solved completely.
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 13:31.


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