Raised This Month: $ Target: $400
 0% 

How to tell if a person has purchased a helmet


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
TGK
Junior Member
Join Date: Jul 2004
Old 07-09-2004 , 08:37   How to tell if a person has purchased a helmet
Reply With Quote #1

Does anyone know how to do this? I tried searching the forums and functions and didnt see anything that will return whether or not a player has purchased/posesses a kevlar helmet.

This would be useful for a headshot modification I am planning on writing, please give me some input =)

-TGK
TGK is offline
Deagle
Veteran Member
Join Date: Jun 2004
Old 07-09-2004 , 08:42  
Reply With Quote #2

kevlar and kevlar/helmet has the exact same indications in armor (100)
so im not sure if there is anything other then that, after a test we did u can take 2 more shots from a glock in head with helmet before dying this is something we been over a couple of times too.

Deag
__________________
http://www.kingpinservers.com
-=(Wickedest Host On Eastcoast)=-
Deagle is offline
kingpin
Veteran Member
Join Date: Apr 2004
Location: kpsforum.com
Old 07-09-2004 , 09:04  
Reply With Quote #3

they have a different id tho kevlar with helmet was given with 16 I remmeber and just kevlar was 15 I think, this is in stipper2...... but I dont know the exact thing for that in amxx.
__________________
kingpin is offline
Send a message via ICQ to kingpin Send a message via AIM to kingpin Send a message via MSN to kingpin Send a message via Yahoo to kingpin Send a message via Skype™ to kingpin
TGK
Junior Member
Join Date: Jul 2004
Old 07-09-2004 , 09:23  
Reply With Quote #4

something like get_user_helmet would be ideal =(
TGK is offline
scafe
Member
Join Date: Jun 2004
Old 07-09-2004 , 12:09  
Reply With Quote #5

well the icon itself (the sprite) is different (it has a helmet on the kevlar) other then that i see no real difference unless you shoot someone in the head with and smg or pistol the it takes 2-4 shots (not sure if this post helps though)
__________________
............................................. ............................................. ...................
............................................. ............................................. ...................
MY SIG IS TO LONG DONT YOU AGREE?
scafe is offline
Johnny got his gun
Veteran Member
Join Date: Jan 2004
Location: Tokyo
Old 07-09-2004 , 12:46  
Reply With Quote #6

I made a quick research and found an interesting offset.

Try this

Code:
const HELMET_OFFSET = 112 stock cs_get_user_helmet(index) {     return get_offset_int(index, HELMET_OFFSET) == 2 }

I noticed that the value at this offset is set to 0 when user has no armor, then 1 when user has bought armor, then 2 when user bought armor + helmet.
Didn't test what happens if user has only armor 1, 34, 99 or whatever. Dont really know when you lose your helmet in CS, maybe after the first shot to your head is a good guess.

Guess I can add this as a native in a future release of cs module, but I can use your feedback on this. What does it (get_offset_int(index, HELMET_OFFSET)) return etc...
Johnny got his gun is offline
AssKicR
Veteran Member
Join Date: Mar 2004
Location: Norway-Europe(GTM+1)
Old 07-09-2004 , 13:08  
Reply With Quote #7

the offset functions are according to BAILOPAN broken in 0.16 and will be/has been fixed in 0.20

if my memory serves me correctly
__________________
My Plugins

Got ??
AssKicR is offline
Dygear
SourceMod Donor
Join Date: Apr 2004
Location: Levittown, NY
Old 07-09-2004 , 15:11  
Reply With Quote #8

What about reading the icon down in the left-bottom side of the screen.
That has the Armor + Helmet.
__________________
Dygear is offline
Send a message via AIM to Dygear Send a message via MSN to Dygear Send a message via Skype™ to Dygear
TGK
Junior Member
Join Date: Jul 2004
Old 07-09-2004 , 16:26  
Reply With Quote #9

I'll be happy to test this this evening, will give you feedback then.
TGK is offline
Ryan
Senior Member
Join Date: May 2004
Location: NH, USA
Old 07-09-2004 , 23:57  
Reply With Quote #10

you can use the "ArmorType" event, used in register event, to catch whena player has armor and/or a helmet.

Code:
#define ARMORTYPE_KEVLAR              0 #define ARMORTYPE_HELMET              1 new g_iArmorType[33]; public Ev_ArmorType( id ) {     if ( read_data( 1 ) )         g_iArmorType[id] = ARMORTYPE_HELMET;     else     {         g_iArmorType[id] = ARMORTYPE_KEVLAR;     }     return PLUGIN_CONTINUE; } public plugin_init() {     // ... other stuff up here     register_event( "ArmorType", "Ev_ArmorType", "be" );     return PLUGIN_CONTINUE; }

Hope this helps
__________________
Warcraft 3: Expansion
Homepage | Downloads | Forums
Ryan is offline
Send a message via AIM to Ryan
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 14:41.


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