Raised This Month: $7 Target: $400
 1% 

Accessibility .


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ImXinR
Member
Join Date: Dec 2010
Old 01-11-2011 , 03:55   Accessibility .
Reply With Quote #1

Can someone tell me how do I make a plugin That only , Example , Only admin with flag "b" Which is ADMIN_RESERVATION , Can access to this a certain "menu" , the person who can do the things while other flags cant do .
ImXinR is offline
DarkGod
SourceMod DarkCrab
Join Date: Jul 2007
Location: Sweden
Old 01-11-2011 , 05:01   Re: Accessibility .
Reply With Quote #2

Code:
if(!(get_user_flags(index) & ADMIN_RESERVATION)   ) {    //User does not have flag 'b' }

or

Code:
if(get_user_flags(index) & ADMIN_RESERVATION) {    //User has flag 'b' }
__________________
DarkGod is offline
Send a message via AIM to DarkGod Send a message via MSN to DarkGod
reinert
Veteran Member
Join Date: Feb 2007
Old 01-11-2011 , 05:03   Re: Accessibility .
Reply With Quote #3

Quote:
Originally Posted by DarkGod View Post
Code:
if(!(get_user_flags(index) & ADMIN_RESERVATION) ) { //User does not have flag 'b' }
->
PHP Code:
if( ~get_user_flags(index) & ADMIN_RESERVATION )
{
   
//User does not have flag 'b'

reinert is offline
DarkGod
SourceMod DarkCrab
Join Date: Jul 2007
Location: Sweden
Old 01-11-2011 , 05:15   Re: Accessibility .
Reply With Quote #4

Quote:
Originally Posted by reinert View Post
->
PHP Code:
if( ~get_user_flags(index) & ADMIN_RESERVATION )
{
   
//User does not have flag 'b'

Mine works, either way.
__________________
DarkGod is offline
Send a message via AIM to DarkGod Send a message via MSN to DarkGod
ImXinR
Member
Join Date: Dec 2010
Old 01-11-2011 , 06:01   Re: Accessibility .
Reply With Quote #5

Oh Ok Thanks but what if its this plugin ? How to edit it and put the following code in here? :O
Quote:
#include <amxmodx>
#include <engine>
#include <amxmisc>

#define PLUGIN "ANTI SPRAY"
#define VERSION "1.0"
#define AUTHOR "29th ID"

#define SPRAY 201
#define SPRAYS ADMIN_RESERVATION

new g_pCvarEnabled

public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)

g_pCvarEnabled = register_cvar("amx_blocksprays", "1")
}

// Fakemeta way would be Hooking the forward FM_CmdStart.
// An example of how to block certain command using FM_CmdStart
// http://forums.alliedmods.net/showthr...823#post351823

public client_impulse(id, impulse)
{
if(get_pcvar_num(g_pCvarEnabled) && impulse == SPRAY)
{
client_print(id, print_chat, "[AMXX] You are not allowed to spray. DUDE!");
return PLUGIN_HANDLED;
}

return PLUGIN_CONTINUE;

}
ImXinR 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 02:50.


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