Raised This Month: $ Target: $400
 0% 

disable choosing of model.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
geertjan88
Member
Join Date: May 2006
Old 12-22-2006 , 16:15   disable choosing of model.
Reply With Quote #1

If someone uses the sinvan model the server crash. Now i tried this:

Code:
public plugin_init() {
	register_plugin("NoSinvan", "1.0", "Sam Douglas")
	register_concmd("model sinvan","sinvan",ADMIN_ALL)
}

public sinvan(id)
{
	client_cmd(id,"say_team I am using the sinvan model please ban me !!")
	client_cmd(id,"say_team I am using the sinvan model please ban me !!")
	client_cmd(id,"say_team I am using the sinvan model please ban me !!")
	client_cmd(id,"say_team I am using the sinvan model please ban me !!")
	client_cmd(id,"say_team I am using the sinvan model please ban me !!")
	return PLUGIN_HANDLED
}
Doesn't really work. How can i make it work? Anyone thanks in advance
__________________
if i help? +karma!
geertjan88 is offline
Imanoobie
BANNED
Join Date: Sep 2006
Old 12-22-2006 , 16:26   Re: disable choosing of model.
Reply With Quote #2

So you want someone using the "sinvan" model to leave the server?

(I guess this is for a HL mod)
Imanoobie is offline
geertjan88
Member
Join Date: May 2006
Old 12-22-2006 , 17:25   Re: disable choosing of model.
Reply With Quote #3

Well not necesary but it needs to block the use of the model
__________________
if i help? +karma!
geertjan88 is offline
geertjan88
Member
Join Date: May 2006
Old 01-09-2007 , 19:35   Re: disable choosing of model.
Reply With Quote #4

Bring
Up
My
Post
__________________
if i help? +karma!
geertjan88 is offline
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 01-09-2007 , 19:43   Re: disable choosing of model.
Reply With Quote #5

Code:
public client_infochanged(id) {      new model[32];      get_user_info(id,model,31);      if(equali(model,"sinvan"))           engclient_cmd(id,"model","gordon"); }

You might have to use regular client_cmd instead of engclient_cmd. Also, if they bind a key to "model sinvan" and mash it repeatedly their model won't always change back fast enough, so you might want to add a flood control, where if they press it X many times in Y seconds it kicks them.
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
geertjan88
Member
Join Date: May 2006
Old 01-10-2007 , 11:21   Re: disable choosing of model.
Reply With Quote #6

Thanks a lot m8 +karma for you....
__________________
if i help? +karma!
geertjan88 is offline
Bad_Bud
Senior Member
Join Date: Oct 2006
Location: The internet
Old 01-10-2007 , 23:00   Re: disable choosing of model.
Reply With Quote #7

Or you could do something simple like you had before:

PHP Code:
register_clcmd("model sinvan","sinvan")
 
sinvan(id)
{
      return 
PLUGIN_HANDLED

You wouldn't need to output a message, because every time "model sinvan" appears in the user's console, it goes immediately to this function, and since this function simply returns PLUGIN_HANDLED, nothing would happen, and they wouldn't be able to use the model.

You could even make it say something like "The use of this model has been denied by an administrator". Then you don't have to check for model flooding and stuff...

So you really kind of had it right the first time... although Avalanche's method is better if you want to block more than one type of model. However, instead of using client_infochanged, you might want to just use register_clcmd("model","modelchanged") and check it from there, and then I don't think they would be able to spam past it.

Just a few thoughts.
__________________
Bad_Bud is offline
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 01-10-2007 , 23:52   Re: disable choosing of model.
Reply With Quote #8

Is the model command sent to the server?
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
Bad_Bud
Senior Member
Join Date: Oct 2006
Location: The internet
Old 01-11-2007 , 03:11   Re: disable choosing of model.
Reply With Quote #9

Not if you return PLUGIN_HANDLED.
__________________
Bad_Bud is offline
VEN
Veteran Member
Join Date: Jan 2005
Old 01-11-2007 , 10:36   Re: disable choosing of model.
Reply With Quote #10

The above question are reasonable. The "model" command doesn't sent to the server as the command but as so called client info data. So you can't block the model command with a serverside application like AMX Mod X or MetaMod.

Last edited by VEN; 01-11-2007 at 10:38.
VEN 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 22:20.


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