AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Crazy~~Who Can HelP Our CS1.5 (https://forums.alliedmods.net/showthread.php?t=54752)

wenlong_115 05-02-2007 21:55

Crazy~~Who Can HelP Our CS1.5
 
1 Attachment(s)
i ran a cs1.5 server on internet in my home..for 3 years.
recently some GuYs Attack the hlds in the server
they type: cmd dlfile maps/de_dust2.bsp
or: cmd dlfile maps/de_dust.bsp ...........
to damage the server .:oops:
i want find a plugin to kick the player who type cmd in the console.~
i konw you will say :why not play cs1.6 ? but i just like 1.5
Also i find one code but not work well

everybody in there please help me . CarzY!:shock:
waiting for you ....online

mateo10 05-03-2007 02:31

Re: Crazy~~Who Can HelP Our CS1.5
 
1 Attachment(s)
Test this.

wenlong_115 05-03-2007 12:07

Re: Crazy~~Who Can HelP Our CS1.5
 
Quote:

Originally Posted by mateo10 (Post 472821)
Test this.

Thx I just Test it ,but not work well
i want to kick the player who type cmd dlfile..... in the game
please give me more help
thx

Styles 05-03-2007 17:00

Re: Crazy~~Who Can HelP Our CS1.5
 
try this
Code:

#include <amxmodx>
#include <amxmisc>

#define KICK_REASON "Rule Violation"

public plugin_init() {
        register_plugin("Check Command", "1.0", "MaTTe/Styles");
        register_clcmd("cmd dlfile", "clcmdDlFile");
}

public clcmdDlFile(id) {
        server_cmd("kick #%i ^"%s^"",id, KICK_REASON)
        return PLUGIN_HANDLED;
}


wenlong_115 05-03-2007 18:04

Re: Crazy~~Who Can HelP Our CS1.5
 
Quote:

Originally Posted by styles (Post 473081)
try this
Code:

#include <amxmodx>
#include <amxmisc>
 
#define KICK_REASON "Rule Violation"
 
public plugin_init() {
    register_plugin("Check Command", "1.0", "MaTTe/Styles");
    register_clcmd("cmd dlfile", "clcmdDlFile");
}
 
public clcmdDlFile(id) {
    server_cmd("kick #%i ^"%s^"",id, KICK_REASON)
    return PLUGIN_HANDLED;
}



Thank You very much. i tested it and didn't work well.:cry:
i type cmd dlfile maps/de_torn.bsp in console when i was in the game,
then the hlds cann't work in sinlence:evil:

regalis 05-03-2007 18:28

Re: Crazy~~Who Can HelP Our CS1.5
 
Are you Admin?

If you aren't Admin then try this version ;)

Code:

#include <amxmodx>
#include <amxmisc>
 
#define KICK_REASON "Rule Violation"
 
public plugin_init() {
    register_plugin("Check Command", "1.0", "MaTTe/Styles");
    register_clcmd("cmd dlfile", "clcmdDlFile");
}
 
public clcmdDlFile(id) {
    server_cmd("kick #%i ^"%s^"",get_user_userid(id), KICK_REASON)
    return PLUGIN_HANDLED;
}

greetz regalis

Drak 05-03-2007 23:03

Re: Crazy~~Who Can HelP Our CS1.5
 
Won't this only work if the user just types in "cmd dlfile"? So, if you have "cmd dlfile maps/blahblah.bsp" it wouldn't work?
Code:
#include <amxmodx> #define PLUGIN "New Plug-In" #define VERSION "1.0" #define AUTHOR "" public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR)         register_concmd("cmd","handle_cmd");         // Add your code here... } public handle_cmd() {     new args[33]     read_argv(1,args,32)         if(containi(args,"dlfile") != 1)     {         // Oh snap!     } }
Note: Don't actually try and use the plugin, i was just demonstrating a point.

wenlong_115 05-04-2007 07:37

Re: Crazy~~Who Can HelP Our CS1.5
 
Quote:

Originally Posted by SixTwin (Post 473177)
Won't this only work if the user just types in "cmd dlfile"? So, if you have "cmd dlfile maps/blahblah.bsp" it wouldn't work?

Code:
</p><p>#include <amxmodx></p><p>&nbsp;</p><p>#define PLUGIN "New Plug-In"</p><p>#define VERSION "1.0"</p><p>#define AUTHOR ""</p><p>&nbsp;</p><p>&nbsp;</p><p>public plugin_init() {</p><p>&nbsp;&nbsp;&nbsp;&nbsp;register_plugin(PLUGIN, VERSION, AUTHOR)</p><p>&nbsp;</p><p>&nbsp;&nbsp;&nbsp;&nbsp;register_concmd("cmd","handle_cmd");</p><p>&nbsp;</p><p>&nbsp;&nbsp;&nbsp;&nbsp;// Add your code here...</p><p>}</p><p>&nbsp;</p><p>public handle_cmd()</p><p>{</p><p>&nbsp;&nbsp;&nbsp;&nbsp;new args[33]</p><p>&nbsp;&nbsp;&nbsp;&nbsp;read_argv(1,args,32)</p><p>&nbsp;</p><p>&nbsp;&nbsp;&nbsp;&nbsp;if(containi(args,"dlfile") != 1)</p><p>&nbsp;&nbsp;&nbsp;&nbsp;{</p><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs p;&nbsp;// Oh snap!</p><p>&nbsp;&nbsp;&nbsp;&nbsp;}</p><p>}</p><p>


Note: Don't actually try and use the plugin, i was just demonstrating a point.

Yes .And i'm sorry for that i can't write a plugin for this because my poor knowleage :cry: ,I just wanT somebody Can give me one plugin to kick the guY who type :cmd dlfile maps/de_dust.bsp( or other maps like de_dust2.bsp/de_toyn.bsp.......) in console in the game .
And then they can't download maps in game.

Thx everybody who have helped me !

God bless You

regalis 05-04-2007 07:50

Re: Crazy~~Who Can HelP Our CS1.5
 
Now i think SixTwin's code is correct i merged the two versions and hope this will work fine..

Code:

#include <amxmodx>
#include <amxmisc>

#define PLUGIN "Check CMD dlfile"
#define VERSION "0.1"
#define AUTHOR "MaTTe/Styles/SixTwin"
#define KICK_REASON "Rule Violation"

public plugin_init()
{
    register_plugin(PLUGIN, VERSION, AUTHOR);
    register_concmd("cmd","handle_cmd");
}

public handle_cmd(id)
{
    new args[33];
    read_argv(1,args,32);
   
    if(containi(args,"dlfile") != -1)
    {
        server_cmd("kick #%i ^"%s^"",get_user_userid(id), KICK_REASON);
        return PLUGIN_HANDLED;
    }
    return PLUGIN_CONTINUE;
}

I'm not sure if this "get_user_userid(id)" is needed...if the code doesn't work change it to "id".
But i think it should work ;)

greetz regalis

djmd378 05-04-2007 13:19

Re: Crazy~~Who Can HelP Our CS1.5
 
Quote:

Originally Posted by regalis (Post 473276)
Now i think SixTwin's code is correct i merged the two versions and hope this will work fine..

Code:

#include <amxmodx>
#include <amxmisc>

#define PLUGIN "Check CMD dlfile"
#define VERSION "0.1"
#define AUTHOR "MaTTe/Styles/SixTwin"
#define KICK_REASON "Rule Violation"

public plugin_init()
{
    register_plugin(PLUGIN, VERSION, AUTHOR);
    register_concmd("cmd","handle_cmd");
}

public handle_cmd(id)
{
    new args[33];
    read_argv(1,args,32);
   
    if(containi(args,"dlfile") != -1)
    {
        server_cmd("kick #%i ^"%s^"",get_user_userid(id), KICK_REASON);
        return PLUGIN_HANDLED;
    }
    return PLUGIN_CONTINUE;
}

I'm not sure if this "get_user_userid(id)" is needed...if the code doesn't work change it to "id".
But i think it should work ;)

greetz regalis


This code doesn't work for all commands. For example, if you had
Code:

    register_concmd("say","handle_cmd");
It would work perfectly fine.

But if you had
Code:

    register_concmd("model","handle_cmd");
It wouldn't work at all. Isn't that weird?


All times are GMT -4. The time now is 06:46.

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