Raised This Month: $ Target: $400
 0% 

Solved Sideweapon v3


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
SoulWeaver16
Senior Member
Join Date: May 2021
Location: Uruguay
Old 08-28-2022 , 19:14   Sideweapon v3
Reply With Quote #1

Hello everyone, I need a hand, could you adapt the code so that I can use the pistols and the knife?
I just made the model quickly
I comment the submodels that it uses:
HTML Code:
0 Blank
1 Knife
2 Deagle
3 Elites
4 FiveSeven
5 Glock
6 P228
7 USP
8 USP NoSil
That the "blank" part that would be used originally, since if you don't have pistols, yes or if you will have the knife in hand
Quote:
Originally Posted by ConnorMcLeod View Post
New version, should support m4 without silencer, model set by .ini file.

Config file :

bw_model : model to use, "models/backweapons2.mdl" by default

bw_nosil : 0/1, use nosil or not, only models backweapons2_ns.mdl and backweapons2_css_ns.mdl supported

bw_maxweapons : max weapons you can see in a player's back (in case your server allow multiple weapons, 1 by default.


Would be usefull if someone could make condition-zero models.


19 feb 2013 : updated to v0.0.5, fixed a bug preventing plugin from working.
g_iMaxPlayers was set under the TEST_3RD define scope.
Attached Files
File Type: sma Get Plugin or Get Source (backweapon3.sma - 96 views - 5.4 KB)
File Type: zip sideweapons.zip (254.7 KB, 183 views)

Last edited by SoulWeaver16; 08-29-2022 at 19:44. Reason: Thanks to kww for helping me by adapting the code
SoulWeaver16 is offline
kww
Senior Member
Join Date: Feb 2021
Location: Russia
Old 08-29-2022 , 17:32   Re: Sideweapon v3
Reply With Quote #2

I didn't test it, so feel free to blame me if it's not working
It should work, but I'm not sure
__________________
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:03. Reason: Removed not working src...
kww is offline
SoulWeaver16
Senior Member
Join Date: May 2021
Location: Uruguay
Old 08-29-2022 , 17:47   Re: Sideweapon v3
Reply With Quote #3

Quote:
Originally Posted by kww View Post
I didn't test it, so feel free to blame me if it's not working
It should work, but I'm not sure
Thanks for your quick reply, I'll give it a try.
I even tried if the model works, but we'll see how it goes

Edit:
Code:
//// sideweapon3.sma
//
// C:\Program Files (x86)\Steam\steamapps\common\Half-Life\czero\addons\amxmodx\scripting\sideweapon3.sma(148) : error 088: number of arguments does not match definition
// C:\Program Files (x86)\Steam\steamapps\common\Half-Life\czero\addons\amxmodx\scripting\sideweapon3.sma(158) : error 088: number of arguments does not match definition
// C:\Program Files (x86)\Steam\steamapps\common\Half-Life\czero\addons\amxmodx\scripting\sideweapon3.sma(108) : warning 204: symbol is assigned a value that is never used: "g_iMaxPlayers"
//
// 2 Errors.
// Could not locate output file compiled\sideweapon3.amx (compile failed).
//
// Compilation Time: 0,34 sec
// ----------------------------------------
__________________
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 17:48.
SoulWeaver16 is offline
kww
Senior Member
Join Date: Feb 2021
Location: Russia
Old 08-29-2022 , 18:01   Re: Sideweapon v3
Reply With Quote #4

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

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

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

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

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