Raised This Month: $ Target: $400
 0% 

DOD:S How to get a player's class?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
bloodsample
Junior Member
Join Date: Dec 2008
Old 12-19-2008 , 13:22   DOD:S How to get a player's class?
Reply With Quote #1

Hi,

How can I find out what class a client is currently playing? (eg Assault, Rifleman, MG, Sniper, Rocket)?

The closest thing I found was GetClientModel but this returns something like model/player/german_sniper.m , etc, etc. I'm worried that this is too specific to the client (ie he/she may be using a different model). Is there a direct way of getting the class?

Thanks
bloodsample is offline
FeuerSturm
AlliedModders Donor
Join Date: Apr 2004
Old 12-19-2008 , 13:28   Re: DOD:S How to get a player's class?
Reply With Quote #2

You can get the class with the following code:

Code:
class = GetEntProp(client, Prop_Send, "m_iPlayerClass")
"class" will be the number of the class then:

0 = Rifleman
1 = Assault
2 = Support
3 = Sniper
4 = MG
5 = Rocket

If you need it team specific, you have to check player's team as well
as the class numbers are the same for axis and allies
FeuerSturm is offline
bloodsample
Junior Member
Join Date: Dec 2008
Old 12-19-2008 , 15:47   Re: DOD:S How to get a player's class?
Reply With Quote #3

awesome, works perfectly, thanks.
bloodsample is offline
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 00:20.


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