Raised This Month: $ Target: $400
 0% 

CMD only for admins


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
~Ice*shOt
Veteran Member
Join Date: Mar 2009
Location: Lithuania
Old 06-27-2009 , 13:30   CMD only for admins
Reply With Quote #1

what i can do cvar only for admins? for example:
register_clcmd("say lol", "say_hook")
~Ice*shOt is offline
Send a message via Skype™ to ~Ice*shOt
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 06-27-2009 , 13:32   Re: CMD only for admins
Reply With Quote #2

PHP Code:
public say_hook(id)
{
    if(!
is_user_admin(id))
        return 
PLUGIN_HANDLED
    
    
// Stuff here.

Why do you mention a cvar?
__________________
fysiks is offline
TitANious
Veteran Member
Join Date: Feb 2009
Location: Denmark
Old 06-27-2009 , 13:35   Re: CMD only for admins
Reply With Quote #3

You can do register_clcmd( "say lol", "say_hook", ADMIN_ADMIN )
__________________
I dislike this.

"A sneeze never comes alone!" <-- Important to remember.
TitANious is offline
Send a message via MSN to TitANious
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 06-27-2009 , 13:37   Re: CMD only for admins
Reply With Quote #4

Quote:
Originally Posted by TitANious View Post
You can do register_clcmd( "say lol", "say_hook", ADMIN_ADMIN )
You can't say only that. That alone will not make it admin only.
__________________
fysiks is offline
TitANious
Veteran Member
Join Date: Feb 2009
Location: Denmark
Old 06-27-2009 , 13:43   Re: CMD only for admins
Reply With Quote #5

It makes id that it's only ADMIN_ADMIN useable? Else why not?
__________________
I dislike this.

"A sneeze never comes alone!" <-- Important to remember.
TitANious is offline
Send a message via MSN to TitANious
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 06-27-2009 , 13:49   Re: CMD only for admins
Reply With Quote #6

Quote:
Originally Posted by TitANious View Post
It makes id that it's only ADMIN_ADMIN useable? Else why not?
It doesn't do anything by itself. You must check the admin's flags in the function if you want to do it that way. You obviously don't know how to make an admin command.
__________________
fysiks is offline
hleV
Veteran Member
Join Date: Mar 2007
Location: Lithuania
Old 06-27-2009 , 14:00   Re: CMD only for admins
Reply With Quote #7

Quote:
Originally Posted by TitANious View Post
It makes id that it's only ADMIN_ADMIN useable? Else why not?
It will only show the command in amx_help if you're admin. It wont make it admin-only.
__________________
hleV is offline
TitANious
Veteran Member
Join Date: Feb 2009
Location: Denmark
Old 06-27-2009 , 14:56   Re: CMD only for admins
Reply With Quote #8

Lol okay
__________________
I dislike this.

"A sneeze never comes alone!" <-- Important to remember.
TitANious is offline
Send a message via MSN to TitANious
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 15:44.


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