Raised This Month: $ Target: $400
 0% 

Clan Chat (Current Version: 2.0)


Post New Thread Reply   
 
Thread Tools Display Modes
cRoSsEd-ThReAdEd
Junior Member
Join Date: Dec 2006
Old 04-30-2007 , 05:43   Re: Clan Chat (Current Version: 2.0)
Reply With Quote #21

I agree. although I'm currently working on it. I can tell you how to fix the team_say though. this is what needs changed,

// Client commands
register_clcmd("say_team","commandChat",ADMIN_LEVEL_D,"^^<message> - displays message to clan members")
that will remove your team_say and replace it as it were your Clan_say. So this is how I modded that.

// Client commands
register_clcmd("clanChat","commandChat",ADMIN_LEVEL_B,"<message> - displays message to clan members")

However. I am still debuggin the Non-Access problem. I think I may have to use a variable or something, but I'm working on it right now.
cRoSsEd-ThReAdEd is offline
cRoSsEd-ThReAdEd
Junior Member
Join Date: Dec 2006
Old 04-30-2007 , 10:05   Re: Clan Chat (Current Version: 2.0)
Reply With Quote #22

Ok. I got it. Here is how you can get it working "WITHOUT" giving your players admin abilities.

however, you will need to give each clan member a flag, the flags you need to give them are "nz". With those two flags,they will be able to view the clan chat, and reply within the clan chat, but not view admin chat or perform any admin commands. You MUST have the z at the end, or they will be able to view the admin chat.

Use the below code:

Code:
#include <amxmodx>
#include <amxmisc>
public plugin_init()
{
    register_plugin("AMX Clan Chat", "2.0", "Infra")
    register_cvar("amx_clan_chat", "2.0", FCVAR_SERVER)
    
    // Console commands
    register_concmd("clanChat","commandConsole",ADMIN_LEVEL_B,"<message>")
    register_concmd("amx_clanchat","commandConsole",ADMIN_LEVEL_B,"<message>")
    
    // Client commands
    register_clcmd("clanChat","commandChat",ADMIN_LEVEL_B,"<message> - displays message to clan members")
    
    
    // Cvars
    register_cvar("amx_cc_clan","<clanname>")
    
    return PLUGIN_CONTINUE
}

public clanChat( id ) 
{
    new players[32], numPlayers
    new message[192]
    new authid[16], name[32]
    new clanName[32]
    

        
    
    
    
    // Get message and remove quotes
    read_args(message, 191)
    remove_quotes(message)    
    // Get user's name
    get_user_name(id, name, 31)
    
    
    
    // Get players currently on server
    get_players(players, numPlayers)
    
    // Get Clan Name
    get_cvar_string("amx_cc_clan", clanName, 31) 
   
    //  (ADMINS) [CI]MooMooJr. :   yay    
    // Declare Clan Permission
    
    format(message, 192, "(%s) %s :   %s", clanName, name, message)
    for(new i = 0; i < numPlayers; i++) 
    {
        // If user has access, then print message for them
       /*All clan members must have the flag nz to use this, it will void all   admin access, but will allow them to view the clan message.*/
        if( access(players[i], ADMIN_LEVEL_B) ) 
        {
            client_print(players[i], print_chat, message)
        }
    }
    
    
    log_amx("Chat: ^"%s<%d><%s><>^" clan chat ^"%s^"",name, id, authid, message)
      log_message("^"%s<%d><%s><>^" triggered ^"amx_clanchat^" (text ^"%s^")",name, id, authid, message)
    
    return PLUGIN_CONTINUE
}

public commandChat ( id,level,cid )
{
    if(!cmd_access(id,level,cid,2))
    {
        return PLUGIN_CONTINUE
    }
    
    new message[2]
    
    read_argv(1,message,1)
    
    if (message[0]!= '#')
    {
        return PLUGIN_CONTINUE
    }
      
      clanChat( id )
      
      return PLUGIN_HANDLED
}

public commandConsole ( id,level,cid )
{
    if(!cmd_access(id,level,cid,2))
    {
        return PLUGIN_CONTINUE
    }

      clanChat( id )
      
      return PLUGIN_HANDLED
}
This is only a temporary fix until i can get my amxx team working with it and make a fix.
Also I advise them to bind it to a key as follows: bind "i" "messagemode clanChat"

Last edited by cRoSsEd-ThReAdEd; 04-30-2007 at 10:06. Reason: Add information
cRoSsEd-ThReAdEd is offline
Gunny
Senior Member
Join Date: Mar 2004
Location: Magnolia, Texas
Old 04-30-2007 , 12:48   Re: Clan Chat (Current Version: 2.0)
Reply With Quote #23

Quote:
Originally Posted by cRoSsEd-ThReAdEd View Post
Ok. I got it. Here is how you can get it working "WITHOUT" giving your players admin abilities.

however, you will need to give each clan member a flag, the flags you need to give them are "nz". With those two flags,they will be able to view the clan chat, and reply within the clan chat, but not view admin chat or perform any admin commands. You MUST have the z at the end, or they will be able to view the admin chat.

Use the below code:

Code:
#include <amxmodx>
#include <amxmisc>
public plugin_init()
{
    register_plugin("AMX Clan Chat", "2.0", "Infra")
    register_cvar("amx_clan_chat", "2.0", FCVAR_SERVER)
    
    // Console commands
    register_concmd("clanChat","commandConsole",ADMIN_LEVEL_B,"<message>")
    register_concmd("amx_clanchat","commandConsole",ADMIN_LEVEL_B,"<message>")
    
    // Client commands
    register_clcmd("clanChat","commandChat",ADMIN_LEVEL_B,"<message> - displays message to clan members")
    
    
    // Cvars
    register_cvar("amx_cc_clan","<clanname>")
    
    return PLUGIN_CONTINUE
}

public clanChat( id ) 
{
    new players[32], numPlayers
    new message[192]
    new authid[16], name[32]
    new clanName[32]
    

        
    
    
    
    // Get message and remove quotes
    read_args(message, 191)
    remove_quotes(message)    
    // Get user's name
    get_user_name(id, name, 31)
    
    
    
    // Get players currently on server
    get_players(players, numPlayers)
    
    // Get Clan Name
    get_cvar_string("amx_cc_clan", clanName, 31) 
   
    //  (ADMINS) [CI]MooMooJr. :   yay    
    // Declare Clan Permission
    
    format(message, 192, "(%s) %s :   %s", clanName, name, message)
    for(new i = 0; i < numPlayers; i++) 
    {
        // If user has access, then print message for them
       /*All clan members must have the flag nz to use this, it will void all   admin access, but will allow them to view the clan message.*/
        if( access(players[i], ADMIN_LEVEL_B) ) 
        {
            client_print(players[i], print_chat, message)
        }
    }
    
    
    log_amx("Chat: ^"%s<%d><%s><>^" clan chat ^"%s^"",name, id, authid, message)
      log_message("^"%s<%d><%s><>^" triggered ^"amx_clanchat^" (text ^"%s^")",name, id, authid, message)
    
    return PLUGIN_CONTINUE
}

public commandChat ( id,level,cid )
{
    if(!cmd_access(id,level,cid,2))
    {
        return PLUGIN_CONTINUE
    }
    
    new message[2]
    
    read_argv(1,message,1)
    
    if (message[0]!= '#')
    {
        return PLUGIN_CONTINUE
    }
      
      clanChat( id )
      
      return PLUGIN_HANDLED
}

public commandConsole ( id,level,cid )
{
    if(!cmd_access(id,level,cid,2))
    {
        return PLUGIN_CONTINUE
    }

      clanChat( id )
      
      return PLUGIN_HANDLED
}
This is only a temporary fix until i can get my amxx team working with it and make a fix.
Also I advise them to bind it to a key as follows: bind "i" "messagemode clanChat"


THANKS, I will give it a try ASAP and report back.
__________________
TEAM FORTRESS 2 - 70.85.30.25:27015
COUNTER-STRIKE SOURCE - 70.85.30.22:27015
COUNTER-STRIKE SOURCE DEATH MATCH - 70.85.30.23:27015
Gunny is offline
Gunny
Senior Member
Join Date: Mar 2004
Location: Magnolia, Texas
Old 05-05-2007 , 00:30   Re: Clan Chat (Current Version: 2.0)
Reply With Quote #24

can you ask them to make it so we can use an clan.cfg file to list all member in?? it would be easier to update for me who has 6 servers running.
__________________
TEAM FORTRESS 2 - 70.85.30.25:27015
COUNTER-STRIKE SOURCE - 70.85.30.22:27015
COUNTER-STRIKE SOURCE DEATH MATCH - 70.85.30.23:27015
Gunny 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 04:17.


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