Raised This Month: $13 Target: $400
 3% 

add access flags


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
itoxicreal
Member
Join Date: Jun 2018
Old 06-01-2020 , 01:18   add access flags
Reply With Quote #1

Hey does anyone know how to add flags for a plugin ,Basically someone needs a certin flag to use this command.

Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fun>

new const PLUGIN[] = "Reset Death"
new const VERSION[] = "0.1"
new const AUTHOR[] = "Mr Miss"


public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_clcmd("say /rs","cmd_rs");

}
public cmd_rs(id)
{
cs_set_user_deaths(id,0);
client_print_color(id,id,"^4|^3| ^4Reset Score ^3|^4| ^4YOUR DEATHS ^1HAVE BEEN SET TO ^4[0]");
return PLUGIN_HANDLED;
}
itoxicreal is offline
MagNNusS
Member
Join Date: May 2018
Location: World of Bushi
Old 06-01-2020 , 08:28   Re: add access flags
Reply With Quote #2

Check if user has those 'certin' flags with get_user_flags
__________________
Just an impractical signature
nothing to see here.
MagNNusS is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 06-01-2020 , 09:15   Re: add access flags
Reply With Quote #3

Add the flag as the third parameter in register_clcmd() and use cmd_access() in the callback function.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
supertrio17
Senior Member
Join Date: May 2020
Location: Serbia
Old 06-01-2020 , 21:34   Re: add access flags
Reply With Quote #4

You can do something like this

PHP Code:
public cmd_rs(id)
{
    if (
has_flag(idt)) //you change your flag here, t for example
    
{
        
cs_set_user_deaths(id,0);
        
client_print_color(id,id,"^4|^3| ^4Reset Score ^3|^4| ^4YOUR DEATHS ^1HAVE BEEN SET TO ^4[0]");
        return 
PLUGIN_HANDLED;
    }


Last edited by supertrio17; 06-01-2020 at 21:35.
supertrio17 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 06:13.


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