Raised This Month: $51 Target: $400
 12% 

[TF2] Restrict command to class


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Cerise
Senior Member
Join Date: Jun 2009
Location: debug_backtrace()
Old 07-26-2013 , 15:08   [TF2] Restrict command to class
Reply With Quote #1

Hey there,

Been thinking about this for quite long, couldn't find something about this.

I'm currently running a server where "sm_ludmila" is available to admins only, whatever the class they're playing.
The thing is, i'd like to allow people to use "sm_ludmila" ONLY if they're in the concerned class.
(Accessing that command would be set in overrides.cfg, i just need to restrict more precisely).

e.g:

1. I'm Scout, i have access to "!ludmila". The plugin should prevent me from having the weapon.
2. I'm heavy, i also have access to the command. The command should be working and ludmila should be in my hands by now.

The best thing would be a separate file to config a command just like in overrides.cfg except that would be a clas instead of the flag

If anyone is up to this :
__________________
Cerise is offline
Drixevel
AlliedModders Donor
Join Date: Sep 2009
Location: Somewhere headbangin'
Old 07-26-2013 , 18:09   Re: [TF2] Restrict command to class
Reply With Quote #2

Code:
if(!TF2_GetPlayerClass(client) == TFClass_Scout)
{
    //Give them the weapon, they aren't scout.
}

Last edited by Drixevel; 07-26-2013 at 18:12.
Drixevel 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 04:04.


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