AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   New Plugin Submissions (https://forums.alliedmods.net/forumdisplay.php?f=26)
-   -   SetViewEntityBody 2 (https://forums.alliedmods.net/showthread.php?t=305150)

1xAero 02-09-2018 12:18

SetViewEntityBody 2
 
3 Attachment(s)
🇸 ​🇪 ​🇹 ​🇻​ 🇮​ 🇪​ 🇼​ 🇪 ​🇳 ​🇹​ 🇮 ​🇹​ 🇾 ​🇧​ 🇴 ​🇩​ 🇾​

Version: 2
Requirements: AmxModX 1.9.0 +


The main function of this API is to change the viewmodel bodygroup.

Code:

//Example of usage, for more open example.sma

#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>


native cs_set_viewmodel_body(pPlayer, iValue);

public plugin_init()
        RegisterHam(Ham_Spawn, "player", "HamF_Spawn_Player_Post", 1);
       
public HamF_Spawn_Player_Post(iPlayer)
{
        if(!is_user_connected(iPlayer))
                return HAM_IGNORED;
       
        cs_set_viewmodel_body(iPlayer, 1) //Set v_ bodygroup number

        return HAM_IGNORED;       
}

Update v2: Aug 2022
- Fixed draw animation bug
- Fixed bug on usp/m4a1 attachments, fixed crash on suicide/death
- Delay on deploy, obs, eject shell moved to taskid
- Fixed Spec OBS USP and M4A1 (silenced/unsilenced weapon check)

Relaxing 02-09-2018 12:33

Re: SetViewEntityBody 2
 
Change "sex" to "gender". :P

1xAero 02-09-2018 13:17

Re: SetViewEntityBody 2
 
Added Linux differences checks on pdata offsets. Code reuploaded.

BTW, sex != gender?

Relaxing 02-09-2018 14:05

Re: SetViewEntityBody 2
 
Quote:

Originally Posted by 1xAero (Post 2577312)
Added Linux differences checks on pdata offsets. Code reuploaded.

BTW, sex != gender?

It's more common to use gender in this case.

1xAero 02-10-2018 08:22

Re: SetViewEntityBody 2
 
Quote:

Originally Posted by Relaxing (Post 2577323)
It's more common to use gender in this case.

So, u don't like SEX)?

Relaxing 02-10-2018 16:53

Re: SetViewEntityBody 2
 
Just read my previous post once again.

Celena Luna 02-10-2018 21:23

Re: SetViewEntityBody 2
 
The main reason that I can't use Hana's ViewEntityBody Plugins is you can't edit Recoil, Accuracy,... (Basicly weapon's data).
If this plugins can solve that problem, I think it will have better use.

1xAero 02-11-2018 00:43

Re: SetViewEntityBody 2
 
Quote:

Originally Posted by Celena Luna (Post 2577583)
The main reason that I can't use Hana's ViewEntityBody Plugins is you can't edit Recoil, Accuracy,... (Basicly weapon's data).
If this plugins can solve that problem, I think it will have better use.

You need better weapon code. Look at Kord 12.7, profile https://forums.alliedmods.net/member.php?u=59151 coding style for weapons and what forwards he is hooking.
In this version there is no attack block. All you need is a bit hook Deploy forward for your weapon and point deploy animation in UpdateClient data (look at GetWeaponDrawAnim function)
That's it, u are done.

1xAero 02-11-2018 02:41

Re: SetViewEntityBody 2
 
Updated, was careless and the path to default CS weapons for unprecaching was wrong.
Should be "models/", but not just "".

Celena Luna 02-12-2018 09:22

Re: SetViewEntityBody 2
 
can you give me an example? I have missed a lot of update in weapon coding because I am focusing on NPC :P


All times are GMT -4. The time now is 20:04.

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