Raised This Month: $ Target: $400
 0% 

console cmd blocker


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
FPcokE
Member
Join Date: Aug 2011
Old 11-03-2011 , 19:56   console cmd blocker
Reply With Quote #1

PHP Code:
#include <amxmodx>

public plugin_init()
{
    
register_plugin("blocker""1.0""cokE")
    
    
register_clcmd("vote""vote_block")

    
register_clcmd("name""name_block")
}

public 
vote_block(id)
{
    
console_print(id"Ikke tilladt!")

    return 
PLUGIN_HANDLED
}

public 
name_block(id)
{
    
console_print(id"Ikke tilladt!")

    return 
PLUGIN_HANDLED

Can someone tell me why the name cmd doesnt get blocked but the vote does? ive also tryed with "kill" cmd, didnt work neither, pls help
FPcokE is offline
kramesa
Veteran Member
Join Date: Feb 2011
Location: Brazil
Old 11-03-2011 , 20:03   Re: console cmd blocker
Reply With Quote #2

Test is:

PHP Code:
#include <amxmodx> 
#include <amxmisc>
#include <fakemeta> 

public plugin_init() 

    
register_plugin("Block change name and vote""1.0""kramesa"
    
register_forward(FM_ClientUserInfoChanged"ClientUserInfoChanged"
    
register_clcmd("vote""CmdBlock")



public 
ClientUserInfoChanged(id

    static const 
name[] = "name" 
    
static szOldName[32], szNewName[32
    
pev(idpev_netnameszOldNamecharsmax(szOldName)) 
    if( 
szOldName[0] ) 
    { 
        
get_user_info(idnameszNewNamecharsmax(szNewName)) 
        if( !
equal(szOldNameszNewName) ) 
        { 
            
set_user_info(idnameszOldName
            return 
FMRES_HANDLED 
        

    } 
    return 
FMRES_IGNORED 
}  

public 
CmdBlock(id)
{
    
console_print(id"Ikke tilladt!")
    return 
PLUGIN_HANDLED_MAIN;

__________________

Last edited by kramesa; 11-03-2011 at 20:04.
kramesa is offline
FPcokE
Member
Join Date: Aug 2011
Old 11-03-2011 , 20:07   Re: console cmd blocker
Reply With Quote #3

Thanks alot but how does it work so that i can add more stuff like the "kill" cmd etc. in the future
FPcokE is offline
FPcokE
Member
Join Date: Aug 2011
Old 11-03-2011 , 20:17   Re: console cmd blocker
Reply With Quote #4

Btw, i only want to block the player to change name him self, cause i got a script that allows me to force name change on the player, but with that i cant use that script either
FPcokE is offline
FPcokE
Member
Join Date: Aug 2011
Old 11-03-2011 , 20:33   Re: console cmd blocker
Reply With Quote #5

is register_clcmd("name", "name_block") wrong? for me it doesnt make sense that it doesnt work like the vote cmd.
FPcokE is offline
MyPc
Senior Member
Join Date: Sep 2011
Old 11-04-2011 , 01:09   Re: console cmd blocker
Reply With Quote #6

Quote:
Originally Posted by FPcokE View Post
is register_clcmd("name", "name_block") wrong? for me it doesnt make sense that it doesnt work like the vote cmd.
Edit button stop double or triple posting
MyPc is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 11-04-2011 , 01:36   Re: console cmd blocker
Reply With Quote #7

You can't register the "name" command. It is a client-side command.

Quote:
Originally Posted by MyPc View Post
Edit button stop double or triple posting
Punctuation!
__________________
fysiks is offline
MyPc
Senior Member
Join Date: Sep 2011
Old 11-04-2011 , 09:22   Re: console cmd blocker
Reply With Quote #8

Quote:
Originally Posted by fysiks View Post
You can't register the "name" command. It is a client-side command.



Punctuation!
I wrote it while walking to school, I didn't have time to write a little comma..

Last edited by MyPc; 11-04-2011 at 09:22.
MyPc is offline
joshknifer
Veteran Member
Join Date: Jun 2011
Location: Denver, CO
Old 11-04-2011 , 12:50   Re: console cmd blocker
Reply With Quote #9

__________________
joshknifer is offline
Send a message via Skype™ to joshknifer
MyPc
Senior Member
Join Date: Sep 2011
Old 11-04-2011 , 14:16   Re: console cmd blocker
Reply With Quote #10

Quote:
Originally Posted by joshknifer View Post
Nice one
MyPc is offline
Reply


Thread Tools
Display Modes

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 14:19.


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