Raised This Month: $ Target: $400
 0% 

Crazy~~Who Can HelP Our CS1.5


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
wenlong_115
Junior Member
Join Date: Mar 2007
Location: CHINA Sheng YanG LIGong
Old 05-02-2007 , 21:55   Crazy~~Who Can HelP Our CS1.5
Reply With Quote #1

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 .
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!
waiting for you ....online
Attached Files
File Type: sma Get Plugin or Get Source (client_cmddown_kick.sma - 951 views - 446 Bytes)
__________________
-=WE*KYO*SA=---moko

Last edited by wenlong_115; 05-02-2007 at 22:10.
wenlong_115 is offline
mateo10
Veteran Member
Join Date: Jan 2006
Old 05-03-2007 , 02:31   Re: Crazy~~Who Can HelP Our CS1.5
Reply With Quote #2

Test this.
Attached Files
File Type: sma Get Plugin or Get Source (checkcmd.sma - 1008 views - 454 Bytes)
mateo10 is offline
wenlong_115
Junior Member
Join Date: Mar 2007
Location: CHINA Sheng YanG LIGong
Old 05-03-2007 , 12:07   Re: Crazy~~Who Can HelP Our CS1.5
Reply With Quote #3

Quote:
Originally Posted by mateo10 View Post
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
__________________
-=WE*KYO*SA=---moko
wenlong_115 is offline
Styles
Veteran Member
Join Date: Jul 2004
Location: California
Old 05-03-2007 , 17:00   Re: Crazy~~Who Can HelP Our CS1.5
Reply With Quote #4

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;
}
Styles is offline
Send a message via AIM to Styles
wenlong_115
Junior Member
Join Date: Mar 2007
Location: CHINA Sheng YanG LIGong
Old 05-03-2007 , 18:04   Re: Crazy~~Who Can HelP Our CS1.5
Reply With Quote #5

Quote:
Originally Posted by styles View Post
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.
i type cmd dlfile maps/de_torn.bsp in console when i was in the game,
then the hlds cann't work in sinlence
__________________
-=WE*KYO*SA=---moko

Last edited by wenlong_115; 05-03-2007 at 18:19.
wenlong_115 is offline
regalis
Veteran Member
Join Date: Jan 2007
Location: F*cking Germany
Old 05-03-2007 , 18:28   Re: Crazy~~Who Can HelP Our CS1.5
Reply With Quote #6

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
__________________

Last edited by regalis; 05-03-2007 at 18:38. Reason: Maybe get_user_userid() needed...
regalis is offline
Drak
Veteran Member
Join Date: Jul 2005
Old 05-03-2007 , 23:03   Re: Crazy~~Who Can HelP Our CS1.5
Reply With Quote #7

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.
__________________
Oh yeah
Drak is offline
Send a message via MSN to Drak
wenlong_115
Junior Member
Join Date: Mar 2007
Location: CHINA Sheng YanG LIGong
Old 05-04-2007 , 07:37   Re: Crazy~~Who Can HelP Our CS1.5
Reply With Quote #8

Quote:
Originally Posted by SixTwin View Post
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 ,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
__________________
-=WE*KYO*SA=---moko
wenlong_115 is offline
regalis
Veteran Member
Join Date: Jan 2007
Location: F*cking Germany
Old 05-04-2007 , 07:50   Re: Crazy~~Who Can HelP Our CS1.5
Reply With Quote #9

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
__________________

Last edited by regalis; 05-04-2007 at 07:53. Reason: typo
regalis is offline
djmd378
Senior Member
Join Date: Sep 2004
Old 05-04-2007 , 13:19   Re: Crazy~~Who Can HelP Our CS1.5
Reply With Quote #10

Quote:
Originally Posted by regalis View Post
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?
__________________
djmd378 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:46.


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