Raised This Month: $ Target: $400
 0% 

clcmd for admin not working


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Fawkes37
Senior Member
Join Date: Jul 2008
Old 08-06-2008 , 14:25   clcmd for admin not working
Reply With Quote #1

register_clcmd("say /flymenu","flymenu",ADMIN_BAN)

im a newbie. its not working. all the clients can use it. what am i doing wrong?

thx in advance
Fawkes37 is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 08-06-2008 , 14:34   Re: clcmd for admin not working
Reply With Quote #2

Are you checking to make sure that the client has ADMIN_BAN access? Cause, anyone can use it, but if you don't check it, it won't stop them
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
Fawkes37
Senior Member
Join Date: Jul 2008
Old 08-06-2008 , 15:04   Re: clcmd for admin not working
Reply With Quote #3

Quote:
Originally Posted by Fawkes37 View Post
im a newbie.

thx in advance
and i dont know shit bro.
so the question would be, how to check it? (if thats what i have to do?)

thx in advance
Fawkes37 is offline
dekken
Veteran Member
Join Date: Jul 2007
Old 08-06-2008 , 15:30   Re: clcmd for admin not working
Reply With Quote #4

post the Full code and ill help you
__________________
Signature Goes Here
dekken is offline
Fawkes37
Senior Member
Join Date: Jul 2008
Old 08-06-2008 , 15:57   Re: clcmd for admin not working
Reply With Quote #5

Quote:
Originally Posted by dekken View Post
post the Full code and ill help you
nah dude, would u just bring out a sample? i mean, i would actaully like to do it myself, learn and shit, so a small sample would be best for me
u know, something like a motd pops up if u write /motd, but only for admin. think that would be a nice example, or wouldnt it?

Last edited by Fawkes37; 08-06-2008 at 16:45.
Fawkes37 is offline
Iwon
BANNED
Join Date: Jul 2008
Old 08-06-2008 , 17:45   Re: clcmd for admin not working
Reply With Quote #6

PHP Code:
#include <amxmodx>

public plugin_init() {
      
register_clcmd("say /motd","MOTD")
      
register_clcmd("say /admin","ADMINMOTD")

public 
MOTD(id)
{
 
//everyone can see
    
show_motd(id,"motd.txt","Message of the Day.")
    return 
PLUGIN_CONTINUE

public 
ADMINMOTD(id)
{
    if(!
is_user_admin(id)) // Only admins can see
    
return PLUGIN_HANDLED
    show_motd
(id,"admin.txt","Message of the Day.")
    return 
PLUGIN_CONTINUE

Iwon is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 08-06-2008 , 18:01   Re: clcmd for admin not working
Reply With Quote #7

Iwon, Didn't help him any. That would just allow ALL admins to access it, not check if they had the ADMIN_BAN flag.


@OP: You can check the users flag using !get_user_flags(id)&ADMIN_BAN
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
Iwon
BANNED
Join Date: Jul 2008
Old 08-06-2008 , 18:14   Re: clcmd for admin not working
Reply With Quote #8

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

public plugin_init() {
    
register_clcmd("say /admin","motd")
}
    
public 
motd(id) {
        if(!
get_user_flags(id) & ADMIN_BAN)
            return 
PLUGIN_CONTINUE
        
        show_motd
(id,"admin.txt","Message of the Day.")

Fixed
Iwon is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 08-06-2008 , 18:15   Re: clcmd for admin not working
Reply With Quote #9

Quote:
Originally Posted by Iwon View Post
PHP Code:
#include <amxmodx>
#include <amxmisc>

public plugin_init() {
    
register_clcmd("say /admin","motd")
}
    
public 
motd(id) {
    if(!
get_user_flags(id) & ADMIN_BAN)
            return 
PLUGIN_HANDLED
        
        show_motd
(0,"admin.txt","Message of the Day.")
    } 
Fixed

Now it is fixed
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
Iwon
BANNED
Join Date: Jul 2008
Old 08-06-2008 , 18:17   Re: clcmd for admin not working
Reply With Quote #10

Quote:
Originally Posted by YamiKaitou View Post
Now it is fixed
Yeh after 2 times i Made some mistakes and fixed them
Iwon 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 05:36.


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