Raised This Month: $344 Target: $400
 86%   Almost there!

Solved Hands according to Class [CS1.6/CZ]


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
SoulWeaver16
Senior Member
Join Date: May 2021
Location: Uruguay
Old 07-07-2022 , 09:02   Hands according to Class [CS1.6/CZ]
Reply With Quote #1

Hello, I have zero compression of the Amxx, they told me that it was impossible or unfeasible due to the limits of the engine, however I want to do it for personal use, I was also looking at SetViewEntityBody 2, and Counter Strike Classes - Extended
So, I understand that Amxx can detect which class is chosen, be it Arctic, Leet, GIGN, Urban, VIP, etc...
I wanted to know, how can I make it take the class and associate it with the corresponding hands. For now I just want to try with the AK, later with the others.
I made the test model with the AK-47 with the skins from Long Sleeved Hands By w0rms.dl (I modified the skins a bit, to make it better match, I tested and it works fine in game.)
Any help is welcome, I leave you the model of the AK-47, it is not the final version

Edit: Plugin here

Change-Log:

* 1.1
- Added: Expand for the rest of the models
- Notes: Famas, Galil and Knife, in progress
- Changed: Shields will not be supported at the moment

* 1.0
- First release. Only AK47

They have this order:
Code:
Arctic

GIGN

GSG9

Guerilla

Leet

SAS

Terror

Urban

VIP
Attached Files
File Type: zip Fix Default Arm Extended.zip (13.07 MB, 2 views)
File Type: zip [CS] v_shield.zip (4.69 MB, 2 views)
File Type: zip v_knife_flare.zip (102.7 KB, 2 views)

Last edited by SoulWeaver16; 08-23-2022 at 13:22. Reason: Plugin made by KayDee
SoulWeaver16 is offline
lexzor
Senior Member
Join Date: Nov 2020
Old 07-07-2022 , 11:03   Re: Hands according to Class [CS1.6]
Reply With Quote #2

what about this
PHP Code:
#include <amxmodx>
#include <cstrike>
#include <hamsandwich>
#include <fakemeta>

enum _:DATA 
{
    
szPlayerModel[32],
    
szWeaponModel[32]
}

new 
g_szPlayerModel[MAX_PLAYERS 1][32];
new 
g_szWeaponModel[MAX_PLAYERS 1][32];

new const 
MODELS[][DATA] =
{
    {
"arcitc""ak47_arctic.mdl"},
    {
"gign""ak47_gign.mdl"}
}

public 
plugin_init()
{
    
RegisterHam(Ham_Spawn"player""PlayerSpawnPost"true);
    
RegisterHam(Ham_Item_Deploy"weapon_ak47""ItemDeployPost"1);
}

public 
plugin_precache()
{
    for(new 
isizeof(MODELS); i++)
    {
        if(
file_exists(MODELS[i][szWeaponModel]))
            
precache_model(MODELS[i][szWeaponModel]);
        else 
log_amx("Model %s does not exists"MODELS[i][szWeaponModel]);
    }
}

public 
ItemDeployPost(weapon_ent)
{
    new 
id get_pdata_cbase(weapon_ent414);
    if (!
pev_valid(id))
        return;
    
    if(
is_user_alive(id) && get_user_weapon(id) == CSW_AK47 && g_szWeaponModel[id][0])
    {
        
set_pev(idpev_viewmodel2g_szWeaponModel[id]);
    }
}

public 
PlayerSpawnPost(id)
{
    
arrayset(g_szPlayerModel[id], 0charsmax(g_szPlayerModel[]))
    if(
is_user_alive(id))
    {
        
cs_get_user_model(idg_szPlayerModel[id], charsmax(g_szPlayerModel[]));
        for(new 
isizeof(MODELS); i++)
        {
            if(
equali(MODELS[i][szPlayerModel], g_szPlayerModel[id]))
                
g_szWeaponModel[id] = MODELS[i][szWeaponModel];
            else 
arrayset(g_szWeaponModel[id], 0charsmax(g_szWeaponModel[]))
        }
    }

i forgot the output of cs_get_user_model, but you can change it

not tested

Last edited by lexzor; 07-07-2022 at 11:04.
lexzor is offline
SoulWeaver16
Senior Member
Join Date: May 2021
Location: Uruguay
Old 07-08-2022 , 01:15   Re: Hands according to Class [CS1.6]
Reply With Quote #3

Quote:
Originally Posted by lexzor View Post
what about this

i forgot the output of cs_get_user_model, but you can change it

not tested
I understand that it would be an easier way, but having 8 different models for a weapon is cumbersome, the model I have has all the skins within the same model, not only compacting its size, but also making it neater, as I said in SetViewEntityBody 2, it seems to be possible to use a submodel that is inside the model, which would make it much easier to use.

Last edited by SoulWeaver16; 07-15-2022 at 07:39.
SoulWeaver16 is offline
SoulWeaver16
Senior Member
Join Date: May 2021
Location: Uruguay
Old 07-15-2022 , 07:37   Re: Hands according to Class [CS1.6]
Reply With Quote #4

* 1.1
- Added: Expand for the rest of the models
- Notes: Famas, Galil and Knife, in progress
- Changed: Shields will not be supported at the moment

Last edited by SoulWeaver16; 07-15-2022 at 18:57.
SoulWeaver16 is offline
lexzor
Senior Member
Join Date: Nov 2020
Old 07-16-2022 , 11:41   Re: Hands according to Class [CS1.6]
Reply With Quote #5

put the code here to get help
lexzor is offline
Reply


Thread Tools
Display Modes

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 09:54.


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