Raised This Month: $ Target: $400
 0% 

protection and info


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
cTn
Senior Member
Join Date: Oct 2005
Old 11-01-2005 , 04:43   protection and info
Reply With Quote #1

Code:
if (!(get_user_flags(id)&ADMIN_LEVEL_A)) { 
		
		return PLUGIN_HANDLED 
	}
if i add this to a plugin ... admin with level A can use them but m question is if someone another users Z flag and another admins .. how can i add message somethin like "u dont have acces to that command" ? pls help me
__________________
cTn is offline
Send a message via ICQ to cTn Send a message via MSN to cTn
[ --<-@ ] Black Rose
ANNIHILATED
Join Date: Sep 2005
Location: Stockholm, Sweden.
Old 11-01-2005 , 06:30  
Reply With Quote #2

Code:
if (!(get_user_flags(id)&ADMIN_LEVEL_A)) {     client_print(id, print_console, "You have no acess to this command")     return PLUGIN_HANDLED }
or
Code:
if (!cmd_access(id,level,cid))
i think this returns the same msg...
[ --<-@ ] Black Rose is offline
cTn
Senior Member
Join Date: Oct 2005
Old 11-01-2005 , 07:34  
Reply With Quote #3

u dont understand me i need to show this message to people who dont have admin level A
__________________
cTn is offline
Send a message via ICQ to cTn Send a message via MSN to cTn
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 11-01-2005 , 07:35  
Reply With Quote #4

I think you mean

Code:
// ... public whatever_func(id,level,cid) // ...

Code:
//... #define ARGS 1 // ... // If the person does not type in only 1 arg (ARGS) (incl. command) it'll stop.     if(!cmd_access(id,level,cid,ARGS))         return 0; // ...
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 11-01-2005 , 07:42  
Reply With Quote #5

If you don't get whole # of args thing, look @ this:

__________________
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
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 11-01-2005 , 07:47  
Reply With Quote #6

For things like read_argv(), 1 is the first argument, not the command itself. (although you can read 0, which is the command itself)

For cmd_access(), args is the total amount of arguments, including the command.

Yeah it makes no sense, but changing it would break backward compatibility I guess.
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
cTn
Senior Member
Join Date: Oct 2005
Old 11-01-2005 , 08:10  
Reply With Quote #7

i still dont understand anything ... haha i am the best newbie ever
__________________
cTn is offline
Send a message via ICQ to cTn Send a message via MSN to cTn
Xanimos
Veteran Member
Join Date: Apr 2005
Location: Florida
Old 11-01-2005 , 10:11  
Reply With Quote #8

Here, I'll be nice and give you a full example.
Code:
#include <amxmodx> #include <amxmisc> public plugin_init() {     register_plugin("blah" , "1.0" , "Suicid3")     register_concmd("amx_test" , "FuncTest" , ADMIN_LEVEL_A , "This is a test") } public FuncTest( id , level , cid) {     if(!cmd_access( id , level , cid , 1)) //meaning no arguments.        return PLUGIN_HANDLED     console_print( id , "[AMXX] You have access!!!!!!")     return PLUGIN_HANDLED }

just try this out and you will see.
Xanimos is offline
Send a message via AIM to Xanimos Send a message via MSN to Xanimos
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 11-01-2005 , 11:49  
Reply With Quote #9

You forgot quotes at the end of the version portion, thus making everything red
__________________
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
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 23:39.


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