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

Solved Get Victim has helmet


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ItsMeMaLi
Junior Member
Join Date: Sep 2018
Old 09-18-2018 , 06:33   Get Victim has helmet
Reply With Quote #1

Hi everybody,
I'm wondering if there's a way to understand if victim has helmet.

With
Code:
int armor = GetClientArmor(victim);
I only get the armor value 0 to 100 no difference if only kevlar or kevlar+helmet.

I'm writing a only hs plugin that will give difference if you have helmet or kevlar.

Thank you

Last edited by ItsMeMaLi; 09-18-2018 at 11:12.
ItsMeMaLi is offline
Shane1390
Member
Join Date: Apr 2018
Old 09-18-2018 , 07:07   Re: Get Victim has helmet
Reply With Quote #2

I'm assuming this is for CS:GO?
Per splewis' 1v1 plugin: https://github.com/splewis/csgo-mult...1v1/generic.sp

Code:
stock void Client_SetHelmet(int client, bool helmet) {
  int offset = FindSendPropInfo("CCSPlayer", "m_bHasHelmet");
  SetEntData(client, offset, helmet);
}
You could just as easily implement a 'get' function like so (untested):

Code:
stock bool Client_GetHelmet(int client) {
  int offset = FindSendPropInfo("CCSPlayer", "m_bHasHelmet");
  return GetEntData(client, offset, 1);
}

Last edited by Shane1390; 09-18-2018 at 07:07. Reason: GetHelmet*
Shane1390 is offline
shanapu
Veteran Member
Join Date: Apr 2015
Location: .de
Old 09-18-2018 , 11:06   Re: Get Victim has helmet
Reply With Quote #3

Quote:
Originally Posted by Shane1390 View Post
...
Code:
stock bool Client_GetHelmet(int client) {
  int offset = FindSendPropInfo("CCSPlayer", "m_bHasHelmet");
  return GetEntData(client, offset, 1);
}
no need for "find offset" when using GetEntProp.
PHP Code:
GetEntProp(clientProp_Send"m_bHasHelmet"
PHP Code:
if (GetEntProp(clientProp_Send"m_bHasHelmet"))
{
     
//has helmet

__________________
coding & free software

Last edited by shanapu; 09-18-2018 at 11:08.
shanapu 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:42.


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