Raised This Month: $ Target: $400
 0% 

model command


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Diegorkable
Veteran Member
Join Date: Jun 2011
Old 06-13-2012 , 15:26   model command
Reply With Quote #1

Hey guys,

people in my server can type in console "model MODEL_NAME" and their model will change to the model they pick. for example typing "model zombie" would make them look like a zombie. I want to block that so I used client_command forward and checked if argv(0) equals to "model", if it is return plugin handled main.

The command is still not being blocked, anyone knows what can I do? Is it a command of the HL engine?
__________________
My Projects:

Auto-Mix (Pug): 100%

Joined the Military (a soldier now) - Inactive

Last edited by Diegorkable; 06-13-2012 at 15:42.
Diegorkable is offline
Liverwiz
Veteran Member
Join Date: Feb 2010
Location: Maryland
Old 06-13-2012 , 15:45   Re: model command
Reply With Quote #2

Quote:
Originally Posted by Diegorkable View Post
Hey guys,

people in my server can type "model MODEL_NAME" and their model change to the model they pick. for example typing "model zombie" would make them look like a zombie. I want to block that so I used client_command forward and checked if argv(0) equals to "model", if it is return plugin handled main.

The command is still not being blocked, anyone knows what can I do? Is it a command of the HL engine?
if you hook the command as such...
Code:
register_clcmd("model", "functionOfBoobs")  //got boobs on the mind, everyone loves boobs
Then just set some sort of opt-out (a CVAR or something) and put it at the beginning of that hook and have it return PLUGIN_HANDLED

PHP Code:
public functionOfBoobs(id)
{
    if(
get_pcvar_num(turnModelOff_pcvar) == 0)
        return 
PLUGIN_HANDLED
    
// put the rest of the stuff here

hope that helped.
If not....show code, not sure what you want
__________________
What an elegant solution to a problem that doesn't need solving....
Liverwiz is offline
Diegorkable
Veteran Member
Join Date: Jun 2011
Old 06-13-2012 , 16:19   Re: model command
Reply With Quote #3

register_clcmd doesnt work in that case. probably because its an HL engine command, I am not sure.
A question: Is it an info? can I use maybe client_infochanged, then read the player's model info and see if he change it? If so, how can I get the old and new one?
Old -> get_user_model()
New -> get_user_info(id, "model")?
__________________
My Projects:

Auto-Mix (Pug): 100%

Joined the Military (a soldier now) - Inactive
Diegorkable is offline
Backstabnoob
BANNED
Join Date: Feb 2009
Location: Iwotadai Dorm
Old 06-13-2012 , 16:33   Re: model command
Reply With Quote #4

Hook FM_SetClientKeyValue and check if the key equals to "model". You can change it to whatever you want there, or just block it.
Backstabnoob is offline
Diegorkable
Veteran Member
Join Date: Jun 2011
Old 06-14-2012 , 09:18   Re: model command
Reply With Quote #5

It doesn't block too =\, why the fuck is that.
__________________
My Projects:

Auto-Mix (Pug): 100%

Joined the Military (a soldier now) - Inactive
Diegorkable is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 06-14-2012 , 15:27   Re: model command
Reply With Quote #6

The command is handled by the client, so the server does not see it in time (or at all, not sure) to be able to block it

You will have to detect when they change their model and then change it back
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).

Last edited by YamiKaitou; 06-14-2012 at 15:27.
YamiKaitou is offline
Diegorkable
Veteran Member
Join Date: Jun 2011
Old 06-15-2012 , 09:21   Re: model command
Reply With Quote #7

Quote:
Originally Posted by YamiKaitou View Post
The command is handled by the client, so the server does not see it in time (or at all, not sure) to be able to block it

You will have to detect when they change their model and then change it back
You know that when you cs_set_user_team someone, it changes his model according to the team, right?
Well, if I use that forward it blocks that model changing after I use cs_set_user_team. if its by the client manually it doesnt block.
__________________
My Projects:

Auto-Mix (Pug): 100%

Joined the Military (a soldier now) - Inactive
Diegorkable is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 06-15-2012 , 14:40   Re: model command
Reply With Quote #8

Quote:
Originally Posted by Diegorkable View Post
You know that when you cs_set_user_team someone, it changes his model according to the team, right?
Yes I am aware, but I don't understand how this is relevant to this thread.

Quote:
Well, if I use that forward it blocks that model changing after I use cs_set_user_team.
What forward? cs_set_user_team is a function to change a players team, not a forward. A forward is something like client_infochanged
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
Diegorkable
Veteran Member
Join Date: Jun 2011
Old 06-16-2012 , 06:55   Re: model command
Reply With Quote #9

Quote:
Originally Posted by YamiKaitou View Post
Yes I am aware, but I don't understand how this is relevant to this thread.


What forward? cs_set_user_team is a function to change a players team, not a forward. A forward is something like client_infochanged
Quote:
Originally Posted by Backstabnoob View Post
Hook FM_SetClientKeyValue and check if the key equals to "model". You can change it to whatever you want there, or just block it.

I'm talking about that forward, I know what a forward is and what a function is.
When I hook FM_SetClientKeyValue and block the key 'model', it doesnt block players from changing their model in console manually, but it does block the changing model of cs_set_user_team.

Got it now?
__________________
My Projects:

Auto-Mix (Pug): 100%

Joined the Military (a soldier now) - Inactive
Diegorkable 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 06:15.


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