Raised This Month: $ Target: $400
 0% 

Solved Normal Chat not working


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
instinctpt1
Senior Member
Join Date: Dec 2016
Location: Chandigarh, India
Old 05-05-2018 , 00:51   Normal Chat not working
Reply With Quote #1

Here is my code ( Totally Hardcoded not for public use )
PHP Code:
#include <amxmodx>
#include <amxmisc>

#define OWNER(%0) (get_user_flags(%0) & ADMIN_RCON)
#define HEADMIN(%0) (get_user_flags(%0) & ADMIN_IMMUNITY)
#define ADMIN(%0) (get_user_flags(%0) & ADMIN_BAN)
#define VIP(%0) (get_user_flags(%0) & ADMIN_RESERVATION)

#define xOWNER "^1[^4OWNER^1]"
#define xHEADMIN "^1[^4HEAD ADMIN^1]"
#define xADMIN "^1[^4ADMIN^1]"
#define xVIP "^1[^4VIP^1]"

#define ALIVE(%0) is_user_alive(%0)

public plugin_init()
{
    
register_plugin("Simple Chat Prefixes""1.1 - BETA""DiGiTaL")
    
register_clcmd("say""handleSay")
    
register_clcmd("say_team""handleTeamSay")
}

public 
handleSay(id) return checkMsg(idfalse)
public 
handleTeamSay(id) return checkMsg(idtrue)

public 
checkMsg(idbool:teamSay)
{
    if(
OWNER(id)) ALIVE(id) ? setMsg(idtruexOWNERtrueteamSay) : setMsg(idtruexOWNERfalseteamSay)
    else if(
HEADMIN(id)) ALIVE(id) ? setMsg(idtruexHEADMINtrueteamSay) : setMsg(idtruexHEADMINfalseteamSay)
    else if(
ADMIN(id)) ALIVE(id) ? setMsg(idtruexADMINtrueteamSay) : setMsg(idtruexADMINfalseteamSay)
    else if(
VIP(id)) ALIVE(id) ? setMsg(idtruexVIPtrueteamSay) : setMsg(idtruexVIPfalseteamSay)
    else if(!
is_user_admin(id)) ALIVE(id) ? setMsg(idfalse""trueteamSay) : setMsg(idfalse""falseteamSay)
    return 
PLUGIN_HANDLED
}

stock setMsg(indexbool:is_admintype[], bool:is_alivebool:is_teamSay)
{
    new 
nMsg[192],szArg[192], szName[32], szTeam[32], players[32], num
    get_user_name
(indexszNamecharsmax(szName))
    
get_user_team(indexszTeamcharsmax(szTeam))

    
read_args(szArgcharsmax(szArg))
    
remove_quotes(szArg)

    if (!
szArg[0] || szArg[0] == '/') return PLUGIN_HANDLED_MAIN

    
if(is_alive)
    {
        if(
is_teamSay)
        {
            
is_admin formatex(nMsgcharsmax(nMsg), "^1(%s) %s ^3%s ^1: ^4%s"szTeamtypeszNameszArg) : formatex(nMsgcharsmax(nMsg), "^1(%s) ^3%s ^1: %s"szTeamszNameszArg)
            
get_players(playersnum"ae"szTeam)
            for(new 
i;numi++) client_print_color(players[i], 0nMsg)
        }
        else
        {
            (
is_admin) ? formatex(nMsgcharsmax(nMsg), "%s ^3%s ^1: ^4%s"typeszNameszArg) : formatex(nMsgcharsmax(nMsg), "^3%s ^1: %s"szNameszArg)
            
client_print_color(00nMsg)
        }
    } 
    else
    {
        if(
is_teamSay)
        {
            (
is_admin) ? formatex(nMsgcharsmax(nMsg), "^1*DEAD* (%s) %s ^3%s ^1: ^4%s"szTeamtypeszNameszArg) : formatex(nMsgcharsmax(nMsg), "^1*DEAD* (%s) ^3%s ^1: %s"szTeamszNameszArg)
            
get_players(playersnum"be"szTeam)
            for(new 
i;numi++) client_print_color(players[i], 0nMsg)
        }
        else 
        {
            (
is_admin) ? formatex(nMsgcharsmax(nMsg), "^1*DEAD* %s ^3%s ^1: ^4%s"typeszNameszArg) : formatex(nMsgcharsmax(nMsg), "^1*DEAD* ^3%s ^1: %s"szNameszArg)
            
get_players(playersnum"b")
            for(new 
i;numi++) client_print_color(players[i], 0nMsg)
        }
    } 
    return 
PLUGIN_HANDLED

I have returned the original say handler to my say func. and added cases in that ...
Now here is problem i m facing :

- Admin chat ( Acc to cases ) working perfect
- Normal player ( Non admin) chat not showing up :/

I have added case to handle normal chat but still not working ...
Most probably i think its the return stopping to use normal chat ..

Help Pro people ..

Last edited by instinctpt1; 05-07-2018 at 12:17. Reason: -
instinctpt1 is offline
 


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 04:42.


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