View Single Post
Author Message
DarthMan
Veteran Member
Join Date: Aug 2011
Old 11-25-2017 , 11:05   [H3LP] PlayerClass Fortress Forever
Reply With Quote #1

Could someone help me in getting and setting the player class id for the game Fortress Forever?

Code:
stock int GetPlayerClass(int client) {     if(!IsPlayer(client))         return 0;         if (GetEngineVersion() == Engine_DarkMessiah)         return GetEntProp(client, Prop_Send, "m_iPlayerClass");         return GetEntProp(client, Prop_Send, "m_iClass"); } stock int SetPlayerClass(int client, int class, bool persistant=false) {     if(!IsPlayer(client))         return 0;         if (GetEngineVersion() == Engine_DarkMessiah)         SetEntProp(client, Prop_Send, "m_iPlayerClass", class);     else         SetEntProp(client, Prop_Send, "m_iClass", class);         if(persistent)         SetEntProp(client, Prop_Send, "m_iDesiredPlayerClass", class);         return 1; }

I tried to print the player class when typing console command classname but it throwed an error so I guess that something might be wrong on the stock maybe?
I got the netprops and it seems that FF indded contains the m_iClass prop.

Thanks !

Last edited by DarthMan; 11-25-2017 at 11:17.
DarthMan is offline