Raised This Month: $ Target: $400
 0% 

Solved Sideweapon v3


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
kww
Senior Member
Join Date: Feb 2021
Location: Russia
Old 08-29-2022 , 18:01   Re: Sideweapon v3
Reply With Quote #1

Now it compiles... Sry
Attached Files
File Type: sma Get Plugin or Get Source (shitweapon3edited_no_knife.sma - 42 views - 4.4 KB)
File Type: sma Get Plugin or Get Source (shitweapon3edited_knife.sma - 39 views - 4.7 KB)
__________________
Now working on: Side Weapons (Very lazy, tbh)
Avatar source: https://bit.ly/3BAk19g
Discord: kww#9951

Last edited by kww; 08-29-2022 at 18:28. Reason: Posted the wrong src
kww is offline
SoulWeaver16
Senior Member
Join Date: May 2021
Location: Uruguay
Old 08-29-2022 , 18:42   Re: Sideweapon v3
Reply With Quote #2

Quote:
Originally Posted by kww View Post
Now it compiles... Sry
It compiles well and doesn't give errors, nor does it log, but it doesn't work, maybe it's the model I made?
I'll take a closer look and see if I can fix anything.
__________________
Extended Arm Weapon Skin v2.1 {16/Apr/23}
(Detect which class is and associate it with the corresponding arms)
SideWeapons v0.2 {01/Sep/22}
(New version of Back Weapons v1.87)

SoulWeaver16 is offline
kww
Senior Member
Join Date: Feb 2021
Location: Russia
Old 08-29-2022 , 18:51   Re: Sideweapon v3
Reply With Quote #3

Quote:
Originally Posted by SoulWeaver16 View Post
It compiles well and doesn't give errors, nor does it log, but it doesn't work, maybe it's the model I made?
I'll take a closer look and see if I can fix anything.
If u dl'd src before I edited my last post, please redownload it, I made a mistype there
__________________
Now working on: Side Weapons (Very lazy, tbh)
Avatar source: https://bit.ly/3BAk19g
Discord: kww#9951
kww is offline
SoulWeaver16
Senior Member
Join Date: May 2021
Location: Uruguay
Old 08-29-2022 , 19:16   Re: Sideweapon v3
Reply With Quote #4

Quote:
Originally Posted by kww View Post
If u dl'd src before I edited my last post, please redownload it, I made a mistype there
This works o: Really thanks


But the version with a knife, it closes the game, I thought it was my model, but it works fine.
Maybe something should be corrected there.
Edit:Then I will fix the model, to correct the position, it is that I made it approximate without reference haha
__________________
Extended Arm Weapon Skin v2.1 {16/Apr/23}
(Detect which class is and associate it with the corresponding arms)
SideWeapons v0.2 {01/Sep/22}
(New version of Back Weapons v1.87)


Last edited by SoulWeaver16; 08-29-2022 at 19:24.
SoulWeaver16 is offline
kww
Senior Member
Join Date: Feb 2021
Location: Russia
Old 08-29-2022 , 19:18   Re: Sideweapon v3
Reply With Quote #5

Quote:
Originally Posted by SoulWeaver16 View Post
This works o: Really thanks


But the version with a knife, it closes the game, I thought it was my model, but it works fine.
Maybe something should be corrected there.
Yeah, I had no idea how to handle that case correctly, so here I can't help you, sorry
Edit: try to add iWeapon = -1 at the end of last while. It crashes because of infinite 'while' (didn't notice that thing)
Or, simply, replace last function (CheckWeapons) with this fixed version:
PHP Code:
CheckWeapons(idiSkipEnt FM_NULLENT)
{
    static 
iMaxWeaponsiMaxWeapons g_iMaxWeapons
    
static iWeaponiWeapon get_pdata_cbase(idm_rgpPlayerItems_CBasePlayer[SECONDARY])
    
    while(
iWeapon 0)
    {
        if(
iWeapon == iSkipEnt || iMaxWeapons <= 0)
        {
            
set_pev(iWeaponpev_effectsEF_NODRAW)
        }
        else
        {
            if(
get_pdata_int(iWeaponm_iIdXO_CBASEPLAYERITEM) == CSW_USP)
            {
                if(
get_pdata_int(iWeaponm_fWeaponStateXO_CBASEPLAYERWEAPON) & WEAPONSTATE_USP_SILENCED)
                {
                    
set_pev(iWeaponpev_bodyUSP)
                }
                else
                {
                    
set_pev(iWeaponpev_bodyUSP_NoSil)
                }
            }

            
set_pev(iWeaponpev_effects0)
            
            --
iMaxWeapons
        
}

        
iWeapon get_pdata_cbase(iWeaponm_pNextXO_CBASEPLAYERITEM)
    }

    
// Sure, this move is so stupid...
    
iWeapon get_pdata_cbase(idm_rgpPlayerItems_CBasePlayer[KNIFE])

    while(
iWeapon 0// Player can have no knife...
    
{
        if(
iWeapon == iSkipEnt)
        {
            
set_pev(iWeaponpev_effectsEF_NODRAW)
        }

        
// Not sure if we need to loop thru knives if player can have only one
        //iWeapon = get_pdata_cbase(iWeapon, m_pNext, XO_CBASEPLAYERITEM)

        
iWeapon 0
    
}

If knives won't work then I can't help you
__________________
Now working on: Side Weapons (Very lazy, tbh)
Avatar source: https://bit.ly/3BAk19g
Discord: kww#9951

Last edited by kww; 08-29-2022 at 19:26.
kww is offline
SoulWeaver16
Senior Member
Join Date: May 2021
Location: Uruguay
Old 08-29-2022 , 19:50   Re: Sideweapon v3
Reply With Quote #6

Quote:
Originally Posted by kww View Post
Yeah, I had no idea how to handle that case correctly, so here I can't help you, sorry
Edit: try to add iWeapon = -1 at the end of last while. It crashes because of infinite 'while' (didn't notice that thing)
Or, simply, replace last function (CheckWeapons) with this fixed version:
PHP Code:
CheckWeapons(idiSkipEnt FM_NULLENT)
{
    static 
iMaxWeaponsiMaxWeapons g_iMaxWeapons
    
static iWeaponiWeapon get_pdata_cbase(idm_rgpPlayerItems_CBasePlayer[SECONDARY])
    
    while(
iWeapon 0)
    {
        if(
iWeapon == iSkipEnt || iMaxWeapons <= 0)
        {
            
set_pev(iWeaponpev_effectsEF_NODRAW)
        }
        else
        {
            if(
get_pdata_int(iWeaponm_iIdXO_CBASEPLAYERITEM) == CSW_USP)
            {
                if(
get_pdata_int(iWeaponm_fWeaponStateXO_CBASEPLAYERWEAPON) & WEAPONSTATE_USP_SILENCED)
                {
                    
set_pev(iWeaponpev_bodyUSP)
                }
                else
                {
                    
set_pev(iWeaponpev_bodyUSP_NoSil)
                }
            }

            
set_pev(iWeaponpev_effects0)
            
            --
iMaxWeapons
        
}

        
iWeapon get_pdata_cbase(iWeaponm_pNextXO_CBASEPLAYERITEM)
    }

    
// Sure, this move is so stupid...
    
iWeapon get_pdata_cbase(idm_rgpPlayerItems_CBasePlayer[KNIFE])

    while(
iWeapon 0// Player can have no knife...
    
{
        if(
iWeapon == iSkipEnt)
        {
            
set_pev(iWeaponpev_effectsEF_NODRAW)
        }

        
// Not sure if we need to loop thru knives if player can have only one
        //iWeapon = get_pdata_cbase(iWeapon, m_pNext, XO_CBASEPLAYERITEM)

        
iWeapon 0
    
}

If knives won't work then I can't help you
Perhaps instead of using the knife trigger, use it like this:
If a pistol is selected, make it default instead of blanking, the knife can't be thrown anyway
__________________
Extended Arm Weapon Skin v2.1 {16/Apr/23}
(Detect which class is and associate it with the corresponding arms)
SideWeapons v0.2 {01/Sep/22}
(New version of Back Weapons v1.87)

SoulWeaver16 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:39.


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