AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   disable choosing of model. (https://forums.alliedmods.net/showthread.php?t=48885)

geertjan88 12-22-2006 16:15

disable choosing of model.
 
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

Imanoobie 12-22-2006 16:26

Re: disable choosing of model.
 
So you want someone using the "sinvan" model to leave the server?

(I guess this is for a HL mod)

geertjan88 12-22-2006 17:25

Re: disable choosing of model.
 
Well not necesary but it needs to block the use of the model

geertjan88 01-09-2007 19:35

Re: disable choosing of model.
 
Bring
Up
My
Post

XxAvalanchexX 01-09-2007 19:43

Re: disable choosing of model.
 
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.

geertjan88 01-10-2007 11:21

Re: disable choosing of model.
 
Thanks a lot m8 +karma for you....

Bad_Bud 01-10-2007 23:00

Re: disable choosing of model.
 
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.

XxAvalanchexX 01-10-2007 23:52

Re: disable choosing of model.
 
Is the model command sent to the server?

Bad_Bud 01-11-2007 03:11

Re: disable choosing of model.
 
Not if you return PLUGIN_HANDLED.

VEN 01-11-2007 10:36

Re: disable choosing of model.
 
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.


All times are GMT -4. The time now is 22:20.

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