Raised This Month: $ Target: $400
 0% 

I want Only admins can use this plugin but I can't help pls


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
lugat2001
New Member
Join Date: Apr 2013
Old 07-02-2014 , 12:53   I want Only admins can use this plugin but I can't help pls
Reply With Quote #1

/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>
#include <engine>
#include <fun>
#include <amxmodx>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"


public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_clcmd("say /100le","can")


}
public can(player) {

if(is_user_connected( player ) && is_user_alive( player ) && get_user_team( player ) == 1)

set_user_health(1,100)


}


I want Only admins can use this plugin but I can't help pls
lugat2001 is offline
Flick3rR
Veteran Member
Join Date: Feb 2014
Location: Bulgaria, Stara Zagora
Old 07-02-2014 , 13:09   Re: I want Only admins can use this plugin but I can't help pls
Reply With Quote #2

Change the flag from this line:
PHP Code:
#define FLAG ADMIN_KICK 
The code:
PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <fun>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"

#define FLAG ADMIN_KICK

public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_clcmd("say /100le","can")
}

public 
can(player) {
    if(
is_user_aliveplayer ) && get_user_team(player) == && get_user_flags(player) & FLAG)

        
set_user_health(player100)

Just have to add a check for the flag via "get_user_flags(player)"
__________________
Flick3rR is offline
Send a message via Skype™ to Flick3rR
lugat2001
New Member
Join Date: Apr 2013
Old 07-02-2014 , 13:19   Re: I want Only admins can use this plugin but I can't help pls
Reply With Quote #3

no I don't want only admins healing
I want all terorist healing
but I want only admins can use /100le command

Last edited by lugat2001; 07-02-2014 at 13:20.
lugat2001 is offline
Porta0123
Member
Join Date: Apr 2014
Location: Spain
Old 07-02-2014 , 13:34   Re: I want Only admins can use this plugin but I can't help pls
Reply With Quote #4

Code:
#include <amxmodx> #include <fun> #define PLUGIN "New Plug-In" #define VERSION "1.0" #define AUTHOR "author" #define FLAG ADMIN_KICK new pnum new players[32], tempid; public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR)     register_clcmd("say /100le","can") } public can(player) {     if(get_user_flags(player) & FLAG)     {     get_players(players, pnum);         for(new i = 0; i < pnum; i++)     {           tempid = players[i];         if(get_user_team(tempid) == 1 && is_user_alive( tempid ))         {              set_user_health(tempid, 100)         }     }     } }
this heal all tt players

Last edited by Porta0123; 07-02-2014 at 13:36.
Porta0123 is offline
lugat2001
New Member
Join Date: Apr 2013
Old 07-02-2014 , 14:16   Re: I want Only admins can use this plugin but I can't help pls
Reply With Quote #5

Quote:
Originally Posted by Porta0123 View Post
Code:
#include <amxmodx> #include <fun> #define PLUGIN "New Plug-In" #define VERSION "1.0" #define AUTHOR "author" #define FLAG ADMIN_KICK new pnum new players[32], tempid; public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR)     register_clcmd("say /100le","can") } public can(player) {     if(get_user_flags(player) & FLAG)     {     get_players(players, pnum);         for(new i = 0; i < pnum; i++)     {           tempid = players[i];         if(get_user_team(tempid) == 1 && is_user_alive( tempid ))         {              set_user_health(tempid, 100)         }     }     } }
this heal all tt players
ty can I publish this on my blog?

Last edited by lugat2001; 07-02-2014 at 14:17.
lugat2001 is offline
Porta0123
Member
Join Date: Apr 2014
Location: Spain
Old 07-02-2014 , 14:35   Re: I want Only admins can use this plugin but I can't help pls
Reply With Quote #6

why not? xd
Porta0123 is offline
lugat2001
New Member
Join Date: Apr 2013
Old 07-02-2014 , 14:38   Re: I want Only admins can use this plugin but I can't help pls
Reply With Quote #7

ty
lugat2001 is offline
mottzi
Veteran Member
Join Date: May 2010
Location: Switzerland
Old 07-02-2014 , 17:37   Re: I want Only admins can use this plugin but I can't help pls
Reply With Quote #8

PHP Code:
public can(player) {
    if(
get_user_flags(player) & FLAG)
    {
        
get_players(playerspnum);
    
        for(new 
0pnumi++)
        {   
            
tempid players[i];
            if(
get_user_team(tempid) == && is_user_alivetempid ))
            {
                
set_user_health(tempid100)
            }
        }
    }


PHP Code:
public can(player) {
    if(
get_user_flags(player) & FLAG)
    {
        
get_players(playerspnum"ae""TERRORIST");
    
        for(new 
0pnumi++)
        {   
            
tempid players[i];
            
set_user_health(tempid100)
        }
    }


Last edited by mottzi; 07-02-2014 at 17:37.
mottzi is offline
Send a message via MSN to mottzi
devilicioux
Veteran Member
Join Date: Jun 2013
Location: Delhi,India
Old 07-03-2014 , 04:31   Re: I want Only admins can use this plugin but I can't help pls
Reply With Quote #9

Why no one is using this way of setting levels of commands ?

PHP Code:
register_clcmd("say /something","cmdSomething",ADMIN_KICK,"- displays Something menu"
PHP Code:
public cmdSomething(id,level,cid) {
if (!
cmd_access(id,level,cid,1))
    return 
PLUGIN_HANDLED //Block if no access 
 
//Do the work if player has access

__________________
You keep bringing ANTICHRISTUS down .. He will rise again and kick asses !

#RespectList ANTICHRISTUS fysiks Bugsy

Most Common Errors You Can Encounter Every Now and Then
devilicioux is offline
mottzi
Veteran Member
Join Date: May 2010
Location: Switzerland
Old 07-03-2014 , 05:54   Re: I want Only admins can use this plugin but I can't help pls
Reply With Quote #10

In the end it comes to the same.
I find the cmd_acess() way less readable than checking with flags manualy...
mottzi is offline
Send a message via MSN to mottzi
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 21:15.


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