Raised This Month: $ Target: $400
 0% 

help with say cmd


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
^SmileY
Veteran Member
Join Date: Jan 2010
Location: Brazil [<o>]
Old 05-21-2013 , 10:51   Re: help with say cmd
Reply With Quote #1

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

new g_Password;

public 
plugin_init()
{
    
register_plugin("Simple Password",AMXX_VERSION_STR,"SmileY");
    
    
g_Password get_cvar_pointer("sv_password");
    
    
register_clcmd("say","cmd_SAY");
    
register_clcmd("say_team","cmd_SAY");
    
    
// To remove a password using this comand, using .password "" (With the double quotes "")
    
register_concmd(".password","cmdPassword",ADMIN_PASSWORD,".password <Password>");
}

public 
cmd_SAY(id)
{
    new 
szArgs[192];
    
read_args(szArgs,charsmax(szArgs));
    
remove_quotes(szArgs);
    
    if(
szArgs[0] == '.')
    {
        
client_cmd(id,szArgs);
        
        return 
PLUGIN_HANDLED// Remove the .password XXX comand from Chat
    
}
    return 
PLUGIN_CONTINUE;
}

public 
cmdPassword(id,level,cid)
{
    if(!
cmd_access(id,level,cid,2)) return PLUGIN_HANDLED;
    
    new 
szArgs[192];
    
read_args(szArgs,charsmax(szArgs));
    
remove_quotes(szArgs);
    
    new 
szName[32];
    
get_user_name(id,szName,charsmax(szName));
    
    if(
equali(szArgs,"^"^""))
    {
        
set_pcvar_string(g_Password,"");
        
        
client_print(0,print_chat,"[AMXX] %s Removed the Password to server!",szName);
        
        return 
PLUGIN_HANDLED;
    }
    else
    {
        
set_pcvar_string(g_Password,szArgs);
        
        
client_print(0,print_chat,"[AMXX] %s Added a new Password to server!",szName);
    }
    
    return 
PLUGIN_CONTINUE;

Use .password XXXX to add, and .password "" to remove the server pass

__________________
Projects:

- See my Git Hub: https://github.com/SmileYzn
PHP Code:
set_pcvar_num(pCvar, !get_pcvar_num(pCvar)); 
^SmileY is offline
Send a message via MSN to ^SmileY Send a message via Skype™ to ^SmileY
kimilover
Junior Member
Join Date: Oct 2010
Old 05-22-2013 , 06:37   Re: help with say cmd
Reply With Quote #2

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

new g_Password;

public 
plugin_init()
{
    
register_plugin("Simple Password",AMXX_VERSION_STR,"SmileY");
    
    
g_Password get_cvar_pointer("sv_password");
    
    
register_clcmd("say","cmd_SAY");
    
register_clcmd("say_team","cmd_SAY");
    
    
// To remove a password using this comand, using .password "" (With the double quotes "")
    
register_concmd(".password","cmdPassword",ADMIN_PASSWORD,".password <Password>");
}

public 
cmd_SAY(id)
{
    new 
szArgs[192];
    
read_args(szArgs,charsmax(szArgs));
    
remove_quotes(szArgs);
    
    if(
szArgs[0] == '.')
    {
        
client_cmd(id,szArgs);
        
        return 
PLUGIN_HANDLED// Remove the .password XXX comand from Chat
    
}
    return 
PLUGIN_CONTINUE;
}

public 
cmdPassword(id,level,cid)
{
    if(!
cmd_access(id,level,cid,2)) return PLUGIN_HANDLED;
    
    new 
szArgs[192];
    
read_args(szArgs,charsmax(szArgs));
    
remove_quotes(szArgs);
    
    new 
szName[32];
    
get_user_name(id,szName,charsmax(szName));
    
    if(
equali(szArgs,"^"^""))
    {
        
set_pcvar_string(g_Password,"");
        
        
client_print(0,print_chat,"[AMXX] %s Removed the Password to server!",szName);
        
        return 
PLUGIN_HANDLED;
    }
    else
    {
        
set_pcvar_string(g_Password,szArgs);
        
        
client_print(0,print_chat,"[AMXX] %s Added a new Password to server!",szName);
    }
    
    return 
PLUGIN_CONTINUE;

Use .password XXXX to add, and .password "" to remove the server pass

thx for your time.but i want to know what i am doing wrong with my code because i am intresting to learn pawn language.
kimilover 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 16:27.


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