Raised This Month: $ Target: $400
 0% 

[how] instead of (id, level, cid)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
avril-lavigne
Banned
Join Date: Apr 2009
Old 04-29-2011 , 23:46   [how] instead of (id, level, cid)
Reply With Quote #1

in this function
public HandleBanhammer(id, level, cid) {
if (!cmd_access(id, level, cid, 1)) return PLUGIN_HANDLED;

it checks an admin access

how to make it
public HandleBanhammer(id)


but with similar check.

if (get_user_flags == ?
__________________
VDS in Europe 1 gb/s unmetered.Any configurations.
I accept Paypal, Moneybookers,etc
avril-lavigne is offline
kNowo
Senior Member
Join Date: Apr 2011
Location: Malaysia
Old 04-29-2011 , 23:54   Re: [how] instead of (id, level, cid)
Reply With Quote #2

yes, AFAIK

Code:
public BanHammer(id)
{
    if(!(get_user_flags(id) & ADMIN_ACCESS_HERE))
        return PLUGIN_HANDLED

    //code here//
    ...
kNowo is offline
avril-lavigne
Banned
Join Date: Apr 2009
Old 04-30-2011 , 00:06   Re: [how] instead of (id, level, cid)
Reply With Quote #3

if (get_user_flags(id) & ADMIN_LEVEL_B) return PLUGIN_HANDLED;

ok found
__________________
VDS in Europe 1 gb/s unmetered.Any configurations.
I accept Paypal, Moneybookers,etc
avril-lavigne is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 04-30-2011 , 00:08   Re: [how] instead of (id, level, cid)
Reply With Quote #4

Why do you not want to use it that way?

You should at least do something like this:

Code:
public cmd_function(id, level)
{
    if( !(get_user_flags(id) & level) )
    {
        return PLUGIN_HANDLED
    }
}
This will let you change the access level in cmdaccess.ini so that it's not entirely hard coded.
__________________
fysiks is offline
reinert
Veteran Member
Join Date: Feb 2007
Old 04-30-2011 , 03:40   Re: [how] instead of (id, level, cid)
Reply With Quote #5

also you should use

~get_user_flags(id) & level

instead

!(get_user_flags(id) & level)
reinert is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 04-30-2011 , 04:37   Re: [how] instead of (id, level, cid)
Reply With Quote #6

Stick with cmd_access.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 04-30-2011 , 17:02   Re: [how] instead of (id, level, cid)
Reply With Quote #7

Quote:
Originally Posted by reinert View Post
also you should use

~get_user_flags(id) & level

instead

!(get_user_flags(id) & level)
It's the same thing.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] 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 04:31.


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