AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   plugin like in the picture (https://forums.alliedmods.net/showthread.php?t=344952)

Hakim Azizov 12-22-2023 14:58

plugin like in the picture
 
1 Attachment(s)
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

WATCH_D0GS UNITED 12-22-2023 16:04

Re: plugin like in the picture
 
Are you talking about this plugin: https://forums.alliedmods.net/showthread.php?t=343890
?

Hakim Azizov 12-22-2023 16:41

Re: plugin like in the picture
 
Quote:

Originally Posted by WATCH_D0GS UNITED (Post 2814808)
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

WATCH_D0GS UNITED 12-22-2023 18:57

Re: plugin like in the picture
 
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



Hakim Azizov 12-24-2023 07:46

Re: plugin like in the picture
 
Quote:

Originally Posted by WATCH_D0GS UNITED (Post 2814814)
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

Jhob94 12-24-2023 08:53

Re: plugin like in the picture
 
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.

Hakim Azizov 12-24-2023 11:23

Re: plugin like in the picture
 
Quote:

Originally Posted by Jhob94 (Post 2814864)
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.

Jhob94 12-24-2023 13:43

Re: plugin like in the picture
 
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.

WATCH_D0GS UNITED 12-24-2023 17:25

Re: plugin like in the picture
 
1 Attachment(s)
@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:

Hakim Azizov 12-25-2023 09:55

Re: plugin like in the picture
 
Quote:

Originally Posted by Jhob94 (Post 2814878)
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.


All times are GMT -4. The time now is 00:32.

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