Raised This Month: $ Target: $400
 0% 

Command block


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
User32
Member
Join Date: Aug 2005
Old 08-16-2005 , 20:30   Command block
Reply With Quote #1

Would this work? And If It does, how would you make It that If someone uses alias command 6 times they get kicked.

Anyway here's what I have so far.
Code:
#include <amxmodx> #include <amxmisc> #define PLUGINNAME  "ALIAS BLOCK" #define VERSION     "NOT DECIDED YET" #define AUTHOR      "User32" public plugin_init() {         register_plugin(PLUGINNAME, VERSION, AUTHOR)      register_clientcmd("alias", "cmdblock") } public cmdblock(id) {                    client_print(id, print_chat, "[AMXX] Do not use aliases!")                   client_print(id, print_console,"[AMXX] Do not use aliases!")           return PLUGIN_HANDLED }
__________________
You just read this sentence! Isn't that fantastic?
User32 is offline
VanillA Ice
Senior Member
Join Date: Apr 2005
Old 08-16-2005 , 20:34  
Reply With Quote #2

here ya go ;)

Code:
#include <amxmodx> #include <amxmisc> new times times = 0 #define PLUGINNAME    "ALIAS BLOCK" #define VERSION        "NOT DECIDED YET" #define AUTHOR        "User32" public plugin_init() {           register_plugin(PLUGINNAME, VERSION, AUTHOR)      register_clientcmd("alias", "cmdblock") } public cmdblock(id) {                     new player[32]                     new name[32]                     player = get_user_name(id, name)                                        client_print(id, print_chat, "[AMXX] Do not use aliases!")                    client_print(id, print_console,"[AMXX] Do not use aliases!")                                   times++                 return PLUGIN_HANDLED                 if( times == 6 ) {                  server_cmd("kick %s Max Aliase Warnings Reached!", player)                } }
__________________
I can no longer help here......school has started... :/ goodbye everybody :'(
VanillA Ice is offline
Send a message via MSN to VanillA Ice Send a message via Yahoo to VanillA Ice
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 08-16-2005 , 20:37  
Reply With Quote #3

Code:
#include <amxmodx> #include <amxmisc> #define PLUGINNAME  "ALIAS BLOCK" #define VERSION     "NOT DECIDED YET" #define AUTHOR      "User32" #define ALIAS_MAX   6 new g_iAliasUses[33] public client_connect(id) g_iAliasUses[id] = 0 public client_disconnect(id) g_iAliasUses[id] = 0 public plugin_init() {     register_plugin(PLUGINNAME, VERSION, AUTHOR)     register_clcmd("alias", "cmdblock") } public cmdblock(id) {     g_iAliasUses[id]++     if(g_iAliasUses[id] >= ALIAS_MAX)         server_cmd("kick #%i ^"Do not use aliases!^"",get_user_userid(id))     client_print(id, print_chat, "[AMXX] Do not use aliases!")     client_print(id, print_console,"[AMXX] Do not use aliases!")     return PLUGIN_HANDLED }
Somethin like that.
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x is offline
User32
Member
Join Date: Aug 2005
Old 08-16-2005 , 20:37  
Reply With Quote #4

You missed the return PLUGIN_HANDLED and a ) at the end of a print chat...Anyways thanks for the help...

/home/groups/amxmodx/tmp/Op0HZ4BT.sma(5) : error 010: invalid function or declaration
/home/groups/amxmodx/tmp/Op0HZ4BT.sma(15) : warning 217: loose indentation
/home/groups/amxmodx/tmp/Op0HZ4BT.sma(15) : error 017: undefined symbol "register_clientcmd"
/home/groups/amxmodx/tmp/Op0HZ4BT.sma(21) : warning 202: number of arguments does not match definition
/home/groups/amxmodx/tmp/Op0HZ4BT.sma(21 -- 23) : error 033: array must be indexed (variable "player")
/home/groups/amxmodx/tmp/Op0HZ4BT.sma(23) : warning 217: loose indentation
/home/groups/amxmodx/tmp/Op0HZ4BT.sma(23) : error 037: invalid string (possibly non-terminated string)
/home/groups/amxmodx/tmp/Op0HZ4BT.sma(26) : warning 217: loose indentation
/home/groups/amxmodx/tmp/Op0HZ4BT.sma(2 : warning 225: unreachable code
/home/groups/amxmodx/tmp/Op0HZ4BT.sma(31) : warning 209: function "cmdblock" should return a value

I'll try to fix this myself.
__________________
You just read this sentence! Isn't that fantastic?
User32 is offline
User32
Member
Join Date: Aug 2005
Old 08-16-2005 , 20:38  
Reply With Quote #5

Oh never mind, v3x fixed It
__________________
You just read this sentence! Isn't that fantastic?
User32 is offline
VanillA Ice
Senior Member
Join Date: Apr 2005
Old 08-16-2005 , 20:39  
Reply With Quote #6

whoops forgot the [id] part or it would kick everybody lol...

GOOD BYE EVERYBODY!!!!!!! My freind will be on here though he homeschooled :/

Freind username : Zenith77

be nice to him he noob
__________________
I can no longer help here......school has started... :/ goodbye everybody :'(
VanillA Ice is offline
Send a message via MSN to VanillA Ice Send a message via Yahoo to VanillA Ice
User32
Member
Join Date: Aug 2005
Old 08-16-2005 , 20:58  
Reply With Quote #7

Can someone test this for me? I do not have a server yet. I only need ONE person to test It. If you test It try alias commands. Such as alias move "+left; wait; wait; +jump; wait; -jump; -left" and other stuff. Six times please.
Attached Files
File Type: sma Get Plugin or Get Source (alias_block.sma - 955 views - 744 Bytes)
__________________
You just read this sentence! Isn't that fantastic?
User32 is offline
Twilight Suzuka
bad
Join Date: Jul 2004
Location: CS lab
Old 08-16-2005 , 21:13  
Reply With Quote #8

That will not work, as I have found time and again. (and was told time and time again, and ignored.)

Alias is handled in the client .dll, and is never sent to the server .dll, and thus cannot be caught with AMXx.
__________________
Twilight Suzuka is offline
Send a message via AIM to Twilight Suzuka Send a message via MSN to Twilight Suzuka
User32
Member
Join Date: Aug 2005
Old 08-16-2005 , 21:20  
Reply With Quote #9

Poopie.
__________________
You just read this sentence! Isn't that fantastic?
User32 is offline
Charr
Senior Member
Join Date: Jul 2005
Location: Long Island, New York, U
Old 08-19-2005 , 20:25  
Reply With Quote #10

Dont use:
Code:
public cmdblock(id) {     g_iAliasUses[id]++     if(g_iAliasUses[id] >= ALIAS_MAX)         server_cmd("kick #%i ^"Do not use aliases!^"",get_user_userid(id))     client_print(id, print_chat, "[AMXX] Do not use aliases!")     client_print(id, print_console,"[AMXX] Do not use aliases!")     return PLUGIN_HANDLED }
Use:
Code:
public cmdblock(id) {     g_iAliasUses[id]++     if(g_iAliasUses[id] >= ALIAS_MAX)         server_cmd("kick #%i ^"Do not use aliases!^"",get_user_userid(id))     client_print(id, print_chat, "[AMXX] Do not use aliases!")     return PLUGIN_HANDLED }

If you put both print chat & console there will be two entries in the console.
__________________
Charr is offline
Send a message via AIM to Charr Send a message via MSN to Charr
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 05:33.


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