Raised This Month: $12 Target: $400
 3% 

SetViewEntityBody 2


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   Counter-Strike        Category:   Gameplay       
1xAero
Member
Join Date: Feb 2018
Location: Sakha, Russia
Old 02-09-2018 , 12:18   SetViewEntityBody 2
Reply With Quote #1

🇸 ​🇪 ​🇹 ​🇻​ 🇮​ 🇪​ 🇼​ 🇪 ​🇳 ​🇹​ 🇮 ​🇹​ 🇾 ​🇧​ 🇴 ​🇩​ 🇾​

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)
Attached Files
File Type: sma Get Plugin or Get Source (example.sma - 1291 views - 1.3 KB)
File Type: sma Get Plugin or Get Source (setviewentitybody.sma - 363 views - 28.7 KB)
File Type: 7z cstrike.7z (3.37 MB, 201 views)

Last edited by 1xAero; 08-14-2022 at 08:13.
1xAero is offline
Relaxing
AlliedModders Donor
Join Date: Jun 2016
Location: White Plains
Old 02-09-2018 , 12:33   Re: SetViewEntityBody 2
Reply With Quote #2

Change "sex" to "gender".
__________________
Relaxing is offline
1xAero
Member
Join Date: Feb 2018
Location: Sakha, Russia
Old 02-09-2018 , 13:17   Re: SetViewEntityBody 2
Reply With Quote #3

Added Linux differences checks on pdata offsets. Code reuploaded.

BTW, sex != gender?

Last edited by 1xAero; 02-09-2018 at 13:18.
1xAero is offline
Relaxing
AlliedModders Donor
Join Date: Jun 2016
Location: White Plains
Old 02-09-2018 , 14:05   Re: SetViewEntityBody 2
Reply With Quote #4

Quote:
Originally Posted by 1xAero View Post
Added Linux differences checks on pdata offsets. Code reuploaded.

BTW, sex != gender?
It's more common to use gender in this case.
__________________
Relaxing is offline
1xAero
Member
Join Date: Feb 2018
Location: Sakha, Russia
Old 02-10-2018 , 08:22   Re: SetViewEntityBody 2
Reply With Quote #5

Quote:
Originally Posted by Relaxing View Post
It's more common to use gender in this case.
So, u don't like SEX)?
1xAero is offline
Relaxing
AlliedModders Donor
Join Date: Jun 2016
Location: White Plains
Old 02-10-2018 , 16:53   Re: SetViewEntityBody 2
Reply With Quote #6

Just read my previous post once again.
__________________
Relaxing is offline
Celena Luna
Veteran Member
Join Date: Aug 2013
Location: Nagazora
Old 02-10-2018 , 21:23   Re: SetViewEntityBody 2
Reply With Quote #7

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.
__________________
My plugin:

Last edited by Celena Luna; 02-10-2018 at 21:24.
Celena Luna is offline
1xAero
Member
Join Date: Feb 2018
Location: Sakha, Russia
Old 02-11-2018 , 00:43   Re: SetViewEntityBody 2
Reply With Quote #8

Quote:
Originally Posted by Celena Luna View Post
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.

Last edited by 1xAero; 02-11-2018 at 00:44.
1xAero is offline
1xAero
Member
Join Date: Feb 2018
Location: Sakha, Russia
Old 02-11-2018 , 02:41   Re: SetViewEntityBody 2
Reply With Quote #9

Updated, was careless and the path to default CS weapons for unprecaching was wrong.
Should be "models/", but not just "".
1xAero is offline
Celena Luna
Veteran Member
Join Date: Aug 2013
Location: Nagazora
Old 02-12-2018 , 09:22   Re: SetViewEntityBody 2
Reply With Quote #10

can you give me an example? I have missed a lot of update in weapon coding because I am focusing on NPC
__________________
My plugin:

Last edited by Celena Luna; 02-12-2018 at 09:22.
Celena Luna 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 06:04.


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