Archived copy of war3source.com, the War3Source forum (2009–2020), rebuilt from the Internet Archive by wc3mods.net. This page was captured on 2012-10-24 (original capture). Forum · All archived topics · Wiki · Bug tracker · Blog
Chat

War3:Source
October 24, 2012, 03:21:41 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Download: http://war3source.com/index.php?board=9.0
What is War3Source?: http://war3source.com/index.php?topic=200.0
Sample Stats: http://war3source.com/war3stats
Steam Community Group: http://steamcommunity.com/groups/war3source
War3Source SVN Checkout: http://ownageclan.com/svn/war3source/
War3Source servers: http://www.game-monitor.com/search.php?vars=war3_version=
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Restricting to a tf2 Class  (Read 247 times)
Ordoxous
Newbie
*
Posts: 20


View Profile
« on: September 27, 2011, 01:16:54 AM »

Would it be possible to resirict a race to a certain tf2 class?
Logged
Revan
Sr. Member
****
Posts: 275



View Profile
« Reply #1 on: September 27, 2011, 02:34:00 AM »

Sure it is possible! just check the class and prevent the player from choosing this race
Logged

#war3source
Ordoxous
Newbie
*
Posts: 20


View Profile
« Reply #2 on: September 27, 2011, 02:59:28 AM »

thanks  Grin

-edit-

Oh, um, how would i go about getting war3source to find the tf2 class?
« Last Edit: September 27, 2011, 03:06:13 AM by Ordoxous » Logged
Glider⠠⠵
Global Moderator
Sr. Member
*****
Posts: 413


⠠⠵


View Profile
« Reply #3 on: September 27, 2011, 08:20:39 AM »

Code:
new TFClassType:player_class = GetPlayerClass(client);

Classes are defined here: http://docs.sourcemod.net/api/index.php?fastload=file&id=49&file=&

Code:
public OnRaceChanged(client, oldrace, newrace)
{
if(newrace == thisRaceID && GetPlayerClass(client) == TFClass_Scout)
{
// deny here
}
}
« Last Edit: September 27, 2011, 08:22:16 AM by Glider⠠⠵ » Logged

Ordoxous
Newbie
*
Posts: 20


View Profile
« Reply #4 on: September 27, 2011, 08:22:49 AM »

thanks
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!