Raised This Month: $ Target: $400
 0% 

TF2 prevent class selection ui


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Fampat
Junior Member
Join Date: Jun 2009
Old 06-10-2009 , 10:57   TF2 prevent class selection ui
Reply With Quote #1

Hi Folks,
iam new to this sourcemod scripting an encountered a problem i cant find a solution to.

To make my arena random class plugin perfect i want to print the player a message that tells him he cant use the class selection, if he uses the "changeclass" command (key).

Right now ive hooked "joinclass" so he gets this message after he has selected a class from the ui, so technicaly it is working, but i would prefer to print this message the moment he presses his key for the class selection ui.

Hooking the command "changeclass" dont work (tried "OnClientCommand" & "RegConsoleCmd"), i think because its a client side only event, so is there a possibility i can block the "changeclass" of the client?
Fampat is offline
bl4nk
SourceMod Developer
Join Date: Jul 2007
Old 06-11-2009 , 03:56   Re: TF2 prevent class selection ui
Reply With Quote #2

You can't block it, sadly. Take a look at this plugin to see how he blocks players from choosing a certain class.
bl4nk is offline
Dragonshadow
BANNED
Join Date: Jun 2008
Old 06-11-2009 , 13:55   Re: TF2 prevent class selection ui
Reply With Quote #3

I don't know much about it, but something like

PHP Code:
 new Handle:cChangeclass FindConVar("changeclass"
Couldn't you then set that as an invalid handle or something?

Last edited by Dragonshadow; 06-11-2009 at 13:58.
Dragonshadow is offline
bl4nk
SourceMod Developer
Join Date: Jul 2007
Old 06-11-2009 , 18:48   Re: TF2 prevent class selection ui
Reply With Quote #4

First off, "changeclass" isn't a ConVar, it's a command. Second, as already stated, you won't be able to find it because it's a client-side command. Third, you can't change a command's handle.
bl4nk is offline
Dragonshadow
BANNED
Join Date: Jun 2008
Old 06-11-2009 , 22:08   Re: TF2 prevent class selection ui
Reply With Quote #5

Hey now I don't know these things, I'm just throwing out ideas xD
Dragonshadow is offline
ZeroFreeze
Junior Member
Join Date: Apr 2009
Old 06-12-2009 , 05:04   Re: TF2 prevent class selection ui
Reply With Quote #6

Quote:
Originally Posted by Dragonshadow View Post
Hey now I don't know these things, I'm just throwing out ideas xD
Sometimes it's better to refrain from giving advice if you "don't know these things".
ZeroFreeze is offline
Dragonshadow
BANNED
Join Date: Jun 2008
Old 06-12-2009 , 10:10   Re: TF2 prevent class selection ui
Reply With Quote #7

Lol probably
Dragonshadow is offline
Fampat
Junior Member
Join Date: Jun 2009
Old 06-12-2009 , 11:43   Re: TF2 prevent class selection ui
Reply With Quote #8

Quote:
Originally Posted by bl4nk View Post
First off, "changeclass" isn't a ConVar, it's a command. Second, as already stated, you won't be able to find it because it's a client-side command. Third, you can't change a command's handle.
Thought so, thanks for the answer.
Fampat is offline
Tf2Ownage
Junior Member
Join Date: Mar 2009
Old 06-12-2009 , 12:19   Re: TF2 prevent class selection ui
Reply With Quote #9

Although I don't know how it was achieved, a few days ago I played a server which blocked you from changing class during the bonus round time, instead it came up with a message saying "You cannot change class at this time", and I remember seeing that message before, in area mode I think (after the 10 second period).
So basically - I'm saying that this IS possible, and that i've seen it done.
Tf2Ownage is offline
DJ Tsunami
DJ Post Spammer
Join Date: Feb 2008
Location: The Netherlands
Old 06-14-2009 , 05:11   Re: TF2 prevent class selection ui
Reply With Quote #10

What about IN_SCORE? I know it says it's used by client.dll, but is it sent to the server too? If so, you can use DukeHacks to set up a client prethink hook, and inside the hook do something like this:

Code:
new iButtons = GetClientButtons(client); if(iButtons & IN_SCORE) {   iButtons &= ~IN_SCORE;   SetEntProp(client, Prop_Data, "m_nButtons", iButtons); }
__________________
Advertisements | REST in Pawn - HTTP client for JSON REST APIs
Please do not PM me with questions. Post in the plugin thread.
DJ Tsunami 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 14:39.


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