Raised This Month: $ Target: $400
 0% 

Detect if player has 2 primary weapons


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
xbatista
Veteran Member
Join Date: Mar 2008
Location: Lithuania
Old 07-04-2009 , 06:07   Detect if player has 2 primary weapons
Reply With Quote #1

^ Topic
xbatista is offline
Send a message via Skype™ to xbatista
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 07-04-2009 , 06:33   Re: Detect if player has 2 primary weapons
Reply With Quote #2

First, check if player has a primary weapon, and if positive, save that weapon entity index.

// weapon offset
#define m_pNext 42

// player offset
#define m_rgpPlayerItems_slot1 368

new iFirstPrimaryWeapon = get_pdata_cbase(id, m_rgpPlayerItems_slot1, 5)


Then, check if that weapon is linked with anither weapon :

Code:
if( iFirstPrimaryWeapon > 0 ) {     new iOtherPrimary = get_pdata_cbase(iFirstPrimaryWeapon, m_pNext, 4)     if( iOtherPrimary )     {         //this player has at least 2 primary weapons     } }
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
xbatista
Veteran Member
Join Date: Mar 2008
Location: Lithuania
Old 07-04-2009 , 06:38   Re: Detect if player has 2 primary weapons
Reply With Quote #3

Thanks!
xbatista is offline
Send a message via Skype™ to xbatista
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 15:43.


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