This site is a testing version, but all data is shared with the live forum.


Raised This Month: $ Target: $400
 0% 

[CS:GO] How to compare Enums


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Pavelas
Junior Member
Join Date: Oct 2016
Old 11-08-2017 , 15:55   [CS:GO] How to compare Enums
Reply With Quote #1

Hello guys,

I have a question about enum. At the moment I am using <cstrike> library and I am trying to use CS_OnCSWeaponDrop function.

As you can see from the API, I am able to get weaponIndex.
PHP Code:
forward Action CS_OnCSWeaponDrop(int clientint weaponIndex); 
I would like to compare weaponIndex. For example, check if it is "awp". Of course I can use GetEntityClassname, but I see that there is enum CSWeaponID.

Is it possible somehow to compare weaponIndex in a clean way?
Something like:
PHP Code:
if (weaponIndex == CSWeapon_AWP)
... 
As you can see "CSWeapon_AWP" is inside enum, is it possible somehow to use it?

Thank you.
Pavelas is offline
 



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 03:35.


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