Raised This Month: $51 Target: $400
 12% 

need help with admin access


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
DarkT1
Member
Join Date: Oct 2011
Old 03-24-2012 , 04:47   need help with admin access
Reply With Quote #1

i need that plugin be only admin can do the cvar like !pass or !nopass

thx
PHP Code:
#include <amxmodx> 

#define PLUGIN  "Pass-Nopass" 
#define AUTHOR  "dark" 
#define VERSION "1.5" 


public plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_clcmd("say""HookSay")
    
register_clcmd("say !nopass""nopassword")


public 
HookSay(id
{
    static 
message[64]
    
read_args (message63)
    
remove_quotes (message)
    
    if( (
message[0] == '!' || message[0] == '/' || message[0] == '.'
    && 
message[1] == 'p' && message[2] == 'a' && message[3] == 's' && message[4] == 's' )
    {
        static 
pass[31];
        
strbreak(messagemessage6pass30);
        
remove_quotes(pass);
            
        {
            
client_cmd(id"amx_rcon sv_password %s"pass)
        }

        
client_print(0print_chat"(text) Password set to %s"pass)
        
        return 
PLUGIN_HANDLED
    
}
    return 
PLUGIN_CONTINUE
}

public 
nopassword(id)
{
new 
name[32
get_user_info(id"name"name31)

     
client_cmd(id"amx_rcon sv_password ^"^"")
     
client_print(0print_chat"(text) Password has been deleted by %s"name)


Last edited by DarkT1; 03-24-2012 at 04:52.
DarkT1 is offline
EpicMonkey
buttmonkey
Join Date: Feb 2012
Old 03-24-2012 , 04:53   Re: need help with admin access
Reply With Quote #2

did you try searching -.- , its so simple ... but search ...
EpicMonkey is offline
DarkT1
Member
Join Date: Oct 2011
Old 03-24-2012 , 04:57   Re: need help with admin access
Reply With Quote #3

^ iknow but i have same error with the "name"

and.. with "static" so can u help me?
DarkT1 is offline
Artifact
Veteran Member
Join Date: Jul 2010
Old 03-24-2012 , 05:28   Re: need help with admin access
Reply With Quote #4

PHP Code:
#include <amxmodx> 
#include <amxmisc>

#define PLUGIN  "Pass-Nopass" 
#define AUTHOR  "dark" 
#define VERSION "1.5" 


public plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_clcmd("say""HookSay")
    
register_clcmd("say !nopass""nopassword"ADMIN_ALL)


public 
HookSay(id
{
    static 
message[64]
    
read_args (message63)
    
remove_quotes (message)
    
    if( (
message[0] == '!' || message[0] == '/' || message[0] == '.'
    && 
message[1] == 'p' && message[2] == 'a' && message[3] == 's' && message[4] == 's' )
{
    static 
pass[31];
    
strbreak(messagemessage6pass30);
    
remove_quotes(pass);
    
{
    if(!
is_user_admin(id)) return PLUGIN_HANDLED;
    
client_cmd(id"amx_rcon sv_password %s"pass)
}

client_print(0print_chat"(text) Password set to %s"pass)

return 
PLUGIN_HANDLED
}
return 
PLUGIN_CONTINUE
}

public 
nopassword(idlevelcid)
{
if( !
cmd_access(idlevelcid2) ) return PLUGIN_HANDLED;
new 
name[32
get_user_info(id"name"name31)
client_cmd(id"amx_rcon sv_password ^"^"")
client_print(0print_chat"(text) Password has been deleted by %s"name)

__________________

Last edited by Artifact; 03-24-2012 at 05:37.
Artifact is offline
DarkT1
Member
Join Date: Oct 2011
Old 03-24-2012 , 05:42   Re: need help with admin access
Reply With Quote #5

Quote:
Originally Posted by Artifact View Post
PHP Code:
#include <amxmodx> 
#include <amxmisc>

#define PLUGIN  "Pass-Nopass" 
#define AUTHOR  "dark" 
#define VERSION "1.5" 


public plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_clcmd("say""HookSay")
    
register_clcmd("say !nopass""nopassword"ADMIN_ALL)


public 
HookSay(id
{
    static 
message[64]
    
read_args (message63)
    
remove_quotes (message)
    
    if( (
message[0] == '!' || message[0] == '/' || message[0] == '.'
    && 
message[1] == 'p' && message[2] == 'a' && message[3] == 's' && message[4] == 's' )
{
    static 
pass[31];
    
strbreak(messagemessage6pass30);
    
remove_quotes(pass);
    
{
    if(!
is_user_admin(id)) return PLUGIN_HANDLED;
    
client_cmd(id"amx_rcon sv_password %s"pass)
}

client_print(0print_chat"(text) Password set to %s"pass)

return 
PLUGIN_HANDLED
}
return 
PLUGIN_CONTINUE
}

public 
nopassword(idlevelcid)
{
if( !
cmd_access(idlevelcid2) ) return PLUGIN_HANDLED;
new 
name[32
get_user_info(id"name"name31)
client_cmd(id"amx_rcon sv_password ^"^"")
client_print(0print_chat"(text) Password has been deleted by %s"name)

/tmp/textclp4Zm.sma(29) : warning 217: loose indentation
/tmp/textclp4Zm.sma(3 : warning 217: loose indentation
/tmp/textclp4Zm.sma(41) : error 001: expected token: ")", but found "."
/tmp/textclp4Zm.sma(41) : error 029: invalid expression, assumed zero
/tmp/textclp4Zm.sma(43) : error 010: invalid function or declaration
/tmp/textclp4Zm.sma(45) : error 021: symbol already defined: "get_user_info"
/tmp/textclp4Zm.sma(4 : warning 203: symbol is never used: "name"

4 Errors.
DarkT1 is offline
Xvil
BANNED
Join Date: Feb 2012
Old 03-24-2012 , 05:51   Re: need help with admin access
Reply With Quote #6

Fixed:
PHP Code:
#include <amxmodx> 
#include <amxmisc>

#define PLUGIN  "Pass-Nopass" 
#define AUTHOR  "dark" 
#define VERSION "1.5" 


public plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_clcmd("say""HookSay")
    
register_clcmd("say !nopass""nopassword")


public 
HookSay(id
{
    static 
message[64]
    
read_args (message63)
    
remove_quotes (message)
    
    if(!
is_user_admin(id))  return PLUGIN_CONTINUE
    
    
if( (message[0] == '!' || message[0] == '/' || message[0] == '.'
    && 
message[1] == 'p' && message[2] == 'a' && message[3] == 's' && message[4] == 's' )
    {
        static 
pass[31];
        
strbreak(messagemessage6pass30);
        
remove_quotes(pass);
            
        {
            
client_cmd(id"amx_rcon sv_password %s"pass)
        }

        
client_print(0print_chat"(text) Password set to %s"pass)
        
        return 
PLUGIN_HANDLED
    
}
    
    return 
PLUGIN_CONTINUE
}

public 
nopassword(id)
{
     new 
name[32
     
     if(!
is_user_admin(id)) return PLUGIN_CONTINUE
    
     get_user_info
(id"name"name31)

     
client_cmd(id"amx_rcon sv_password ^"^"")
     
client_print(0print_chat"(text) Password has been deleted by %s"name)
     return 
PLUGIN_HANDLED


Last edited by Xvil; 03-24-2012 at 05:51.
Xvil is offline
DarkT1
Member
Join Date: Oct 2011
Old 03-24-2012 , 05:54   Re: need help with admin access
Reply With Quote #7

thx every body
DarkT1 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 15:23.


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