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

[Dyn Native] ColorChat v0.3.2 (04 jul 2013)


Post New Thread Reply   
 
Thread Tools Display Modes
amxxlover
Junior Member
Join Date: Mar 2010
Old 03-20-2010 , 16:58   Re: [Native] ColorChat v0.1.0
Reply With Quote #71

Another problem. I tried to make the native colorchat working in the default statsx plugin by adding the line #include <chatcolor> on top of the plugin and edited the below part of the code.

PHP Code:
// Display user stats.
public cmdMe(id)
{
    if (!
SayMe)
    {
        
client_print(idprint_chat"%L"id"DISABLED_MSG")
        return 
PLUGIN_HANDLED
    
}
    
    
format_kill_vinfo(id0g_sBuffer)
    
//client_print(id, print_chat, "* %s", g_sBuffer)  //old
    
client_print_color(idprint_chat"* %s"g_sBuffer)
    
    return 
PLUGIN_CONTINUE

In the statsx.txt file i replaced
PHP Code:
LAST_RES Last result: %d hit(s), %d damage 
with
PHP Code:
LAST_RES Last !gresult!n: %d hit(s), %d damage 
Compilling went fine but ingame i see this


Last edited by amxxlover; 03-20-2010 at 17:53.
amxxlover is offline
Kreation
Veteran Member
Join Date: Jan 2010
Location: Illinois
Old 03-24-2010 , 19:27   Re: [Native] ColorChat v0.1.0
Reply With Quote #72

No team color? D:
__________________
Hi.
Kreation is offline
DarkGod
SourceMod DarkCrab
Join Date: Jul 2007
Location: Sweden
Old 03-24-2010 , 19:37   Re: [Native] ColorChat v0.1.0
Reply With Quote #73

Quote:
Originally Posted by Kreation View Post
No team color? D:
Quote:
Originally Posted by ConnorMcLeod View Post
Colors for second arg are : DontChange (let original player team color), Red, Blue and Grey.
Those color are applied by !t tag.
__________________
DarkGod is offline
Send a message via AIM to DarkGod Send a message via MSN to DarkGod
Kreation
Veteran Member
Join Date: Jan 2010
Location: Illinois
Old 03-24-2010 , 21:06   Re: [Native] ColorChat v0.1.0
Reply With Quote #74

It seems I forgot how to read. My bad.
__________________
Hi.
Kreation is offline
GXLZPGX
Veteran Member
Join Date: Sep 2009
Old 04-01-2010 , 22:26   Re: [Native] ColorChat v0.1.0
Reply With Quote #75

PHP Code:
        switch(get_pcvar_num(amx_show_activity))    {
            case 
2:    client_print_chat(0DontChange,"^4[RG] %L"LANG_PLAYER"AMX_SUPER_NOCLIP_TEAM_CASE2",name,noclipsetting,arg[1])
            case 
1:    client_print(0,print_chat,"%L"LANG_PLAYER"AMX_SUPER_NOCLIP_TEAM_CASE1",noclipsetting,arg[1])
        } 
Did I go about this correctly?
__________________
Currently accepting payment US DOLLARS ONLY for custom plugins, contact me through PM.
GXLZPGX is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 04-02-2010 , 01:29   Re: [Native] ColorChat v0.1.0
Reply With Quote #76

If you want to print all the sentence in green, yes.
ML seems to be buggy when you pass id=0 though.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
GXLZPGX
Veteran Member
Join Date: Sep 2009
Old 04-02-2010 , 08:01   Re: [Native] ColorChat v0.1.0
Reply With Quote #77

Quote:
Originally Posted by ConnorMcLeod View Post
If you want to print all the sentence in green, yes.
ML seems to be buggy when you pass id=0 though.
Now, when I compile it, the command "amx_noclip" doesn't work anymore. That is the command that I added color to.
__________________
Currently accepting payment US DOLLARS ONLY for custom plugins, contact me through PM.
GXLZPGX is offline
@-<Ruedas>-@
Senior Member
Join Date: May 2010
Location: Venezuela
Old 08-08-2010 , 18:11   Re: [Native] ColorChat v0.1.0
Reply With Quote #78

Greetings, ConnorMcLeod, the plugins works 100% fine, but I have a question. If you would like to add more colors, as one might do.

Example: I would like to add the white, yellow, etc. File: chatcolor.inc, you add something?
Code:
#if defined _chatcolor_included
  #endinput
#endif
#define _chatcolor_included

#pragma reqlib chatcolor

enum _:Colors {
    DontChange,
    Red,
    Blue,
    white,
    yellow,
    Grey
}
native client_print_color(id, iColor=DontChange, const szMsg[], any:...)
And how would the code archive: colorchat.sma
Could you show me the way, in order to add more colors to your code.
@-<Ruedas>-@ is offline
Send a message via MSN to @-<Ruedas>-@
Javivi
AlliedModders Donor
Join Date: Dec 2008
Old 08-08-2010 , 18:12   Re: [Native] ColorChat v0.1.0
Reply With Quote #79

Quote:
Originally Posted by @-<Ruedas>-@ View Post
Greetings, ConnorMcLeod, the plugins works 100% fine, but I have a question. If you would like to add more colors, as one might do.

Example: I would like to add the white, yellow, etc. File: chatcolor.inc, you add something?
Code:
#if defined _chatcolor_included
  #endinput
#endif
#define _chatcolor_included

#pragma reqlib chatcolor

enum _:Colors {
    DontChange,
    Red,
    Blue,
    white,
    yellow,
    Grey
}
native client_print_color(id, iColor=DontChange, const szMsg[], any:...)
And how would the code archive: colorchat.sma
Could you show me the way, in order to add more colors to your code.
You can't add more colors, colors are hardcoded into hl engine
__________________
Javivi is offline
yokomo
Surprise Ascot!
Join Date: May 2010
Location: Malaysia
Old 09-21-2010 , 15:42   Re: [Native] ColorChat v0.1.0
Reply With Quote #80

PHP Code:
#include <amxmodx>
#include <fakemeta>
#include <chatcolor>

/****** Customization Area ******/
// Flag to allow admin to reconnect without hudmessage
// This is usefull when you reconnect with another nick to watch a suspected cheater
// This will still set back your score/money/...
#define ADMIN_SILENT ADMIN_KICK

// Color for hud message
#define RED    0
#define GREEN    100
#define BLUE    200
/********************************/

#define PLUGIN "Reconnect Features"
#define AUTHOR "ConnorMcLeod"
#define VERSION "0.2.4 BETA"

#define MAX_PLAYERS    32
#define MAX_STORED     64

#define OFFSET_CSMONEY    115
#define OFFSET_CSDEATHS    444

#define TASK_KILL    1946573517
#define TASK_CLEAR    2946573517
#define TASK_PLAYER     3946573517


enum Storage {
    
StoreSteamId[20],
    
StoreFrags,
    
StoreDeaths,
    
StoreMoney,
    
StoreRound
}

new 
g_CurInfos[MAX_PLAYERS+1][Storage]
new 
g_StoredInfos[MAX_STORED][Storage]

new 
bool:g_bPlayerNonSpawnEvent[MAX_PLAYERS 1]
new 
g_iFwFmClientCommandPost

new g_iRoundNum

new g_pcvarTimeg_pcvarScoreg_pcvarMoneyg_pcvarSpawng_pcvarStartMoneyg_pcvarNotify
new mp_startmoney
new g_msgidDeathMsg
new g_iMaxPlayers

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_dictionary("reconnect.txt")

    
register_cvar("reconnect_features"VERSIONFCVAR_SERVER|FCVAR_EXTDLL|FCVAR_SPONLY)
    
g_pcvarTime register_cvar("amx_noreconnect_time""40")
    
g_pcvarScore register_cvar("amx_noreconnect_score""1")
    
g_pcvarMoney register_cvar("amx_noreconnect_money""0")
    
g_pcvarSpawn register_cvar("amx_noreconnect_spawn""1")
    
g_pcvarStartMoney register_cvar("amx_noreconnect_startmoney""0")
    
g_pcvarNotify register_cvar("amx_noreconnect_notify""1")

    
register_event("HLTV""eNewRound""a""1=0""2=0")

    
register_event("TextMsg""eRestart""a""2&#Game_C""2&#Game_w")

    
register_event("ResetHUD""Event_ResetHUD""b")
    
register_event("TextMsg""Event_TextMsg_GameWillRestartIn""a""2=#Game_will_restart_in")
    
register_clcmd("fullupdate""ClientCommand_fullupdate")

    
register_event("Money""eMoney""be")
    
register_event("ScoreInfo""eScoreInfo""a")
}

public 
plugin_cfg()
{
    
mp_startmoney get_cvar_pointer("mp_startmoney")
    
g_msgidDeathMsg get_user_msgid("DeathMsg")
    
g_iMaxPlayers global_get(glb_maxClients)
}

public 
Event_TextMsg_GameWillRestartIn()
{
    static 
id
    
for(id 1id <= g_iMaxPlayers; ++id)
        if( 
is_user_alive(id) )
            
g_bPlayerNonSpawnEvent[id] = true
}

public 
ClientCommand_fullupdate(id)
{
    
g_bPlayerNonSpawnEvent[id] = true
    
static const szClientCommandPost[] = "Forward_ClientCommand_Post"
    
g_iFwFmClientCommandPost register_forward(FM_ClientCommandszClientCommandPost1)
    return 
PLUGIN_CONTINUE
}

public 
Forward_ClientCommand_Post(id)
{
    
unregister_forward(FM_ClientCommandg_iFwFmClientCommandPost1)
    
g_bPlayerNonSpawnEvent[id] = false
    
return FMRES_HANDLED
}

public 
Event_ResetHUD(id)
{
    if (!
is_user_alive(id))
        return

    if (
g_bPlayerNonSpawnEvent[id])
    {
        
g_bPlayerNonSpawnEvent[id] = false
        
return
    }

    
Forward_PlayerSpawn(id)
}

Forward_PlayerSpawn(id)
{
    if(
g_CurInfos[id][StoreRound] == g_iRoundNum)
    {
        
g_CurInfos[id][StoreRound] = 0
        set_task
(0.1"task_delay_kill"id+TASK_KILL)
    }
}

public 
task_delay_kill(id)
{
    
id -= TASK_KILL

    
new Float:fFrags
    pev
(idpev_fragsfFrags)
    
set_pev(idpev_frags, ++fFrags)

    
set_pdata_int(idOFFSET_CSDEATHSget_pdata_int(idOFFSET_CSDEATHS) - 1)

    new 
msgblock get_msg_block(g_msgidDeathMsg)
    
set_msg_block(g_msgidDeathMsgBLOCK_ONCE)
    
dllfunc(DLLFunc_ClientKillid)
    
set_msg_block(g_msgidDeathMsgmsgblock)

    
client_print_color(idDontChange"%L"id"RF_SPAWN")
}

public 
eMoney(id)
{
    
g_CurInfos[id][StoreMoney] = read_data(1)
}

public 
eScoreInfo()
{
    new 
id read_data(1)
    if(!(
1<= id <= g_iMaxPlayers))
        return

    
g_CurInfos[id][StoreFrags] = read_data(2)
    
g_CurInfos[id][StoreDeaths] = read_data(3)
}

public 
eRestart()
{
    for(new 
iMAX_STOREDi++)
    {
        
remove_task(i+TASK_CLEAR)
        
remove_task(i+TASK_PLAYER)
        
g_StoredInfos[i][StoreSteamId][0] = 0
    
}
}

public 
eNewRound()
{
    
g_iRoundNum++
}

public 
client_disconnect(id)
{
    if(
is_user_bot(id) || is_user_hltv(id))
    {
        return
    }

    new 
Float:fTaskTime get_pcvar_float(g_pcvarTime)
    if(!
fTaskTime)
        return

    static 
iFree
    
for(iFree 0iFree <= MAX_STOREDiFree++)
    {
        if(
iFree == MAX_STORED)
        {
            return
        }
        if(!
g_StoredInfos[iFree][StoreSteamId][0])
            break
    }

    
copy(g_StoredInfos[iFree][StoreSteamId], 19g_CurInfos[id][StoreSteamId])
    
g_StoredInfos[iFree][StoreFrags] = g_CurInfos[id][StoreFrags]
    
g_StoredInfos[iFree][StoreDeaths] = g_CurInfos[id][StoreDeaths]
    
g_StoredInfos[iFree][StoreMoney] = g_CurInfos[id][StoreMoney]
    
g_StoredInfos[iFree][StoreRound] = g_iRoundNum

    g_CurInfos
[id][StoreSteamId][0] = 0
    g_CurInfos
[id][StoreFrags] = 0
    g_CurInfos
[id][StoreDeaths] = 0
    g_CurInfos
[id][StoreMoney] = 0
    g_CurInfos
[id][StoreRound] = 0

    set_task
(fTaskTime"task_clear"iFree+TASK_CLEAR)
}

public 
task_clear(iTaskId)
{
    
iTaskId -= TASK_CLEAR
    g_StoredInfos
[iTaskId][StoreSteamId][0] = 0
}

public 
client_putinserver(id)
{
    if(
is_user_bot(id) || is_user_hltv(id))
        return

    
g_bPlayerNonSpawnEvent[id] = false

    
static szSteamId[20]
    
get_user_authid(idszSteamId19)
    
copy(g_CurInfos[id][StoreSteamId], 19szSteamId)

    for(new 
iMAX_STOREDi++)
    {
        if(!
g_StoredInfos[i][StoreSteamId][0])
            continue

        if( 
equal(g_StoredInfos[i][StoreSteamId], szSteamIdstrlen(szSteamId)) )
        {
            if(
get_pcvar_num(g_pcvarScore))
            {
                
set_pev(idpev_fragsfloat(g_StoredInfos[i][StoreFrags]))
                
set_pdata_int(idOFFSET_CSDEATHSg_StoredInfos[i][StoreDeaths])
                
g_CurInfos[id][StoreFrags] = g_StoredInfos[i][StoreFrags]
                
g_CurInfos[id][StoreDeaths] = g_StoredInfos[i][StoreDeaths]
            }
            if(
get_pcvar_num(g_pcvarMoney))
            {
                new 
iMoney g_StoredInfos[i][StoreMoney]
                new 
iStartMoney get_pcvar_num(mp_startmoney)
                if(
get_pcvar_num(g_pcvarStartMoney) && iMoney iStartMoney)
                {
                    
set_pdata_int(idOFFSET_CSMONEYiStartMoney)
                    
g_CurInfos[id][StoreMoney] = iStartMoney
                
}
                else
                {
                    
set_pdata_int(idOFFSET_CSMONEYiMoney)
                    
g_CurInfos[id][StoreMoney] = iMoney
                
}
            }
            if(
get_pcvar_num(g_pcvarSpawn))
            {
                
g_CurInfos[id][StoreRound] = g_StoredInfos[i][StoreRound]
            }

            
remove_task(id+TASK_PLAYER)
            
set_task(10.0"task_print_player"id+TASK_PLAYER)

            
g_StoredInfos[i][StoreSteamId][0] = 0

            
new iNotifyType get_pcvar_num(g_pcvarNotify)
            if(
iNotifyType && !(get_user_flags(id)&ADMIN_SILENT) )
            {
                static 
szName[32]
                
get_user_name(idszName31)
                if( 
iNotifyType == )
                {
                    
set_hudmessage(REDGREENBLUE, -1.00.3523.010.00.10.2, -1)
                    
show_hudmessage(0"%L"LANG_PLAYER"RF_ALL"szName)
                }
                else
                {
                    
client_print_color(0DontChange"%L"id"RF_ALL"szName)
                }
            }
            return
        }
    }
    
g_CurInfos[id][StoreRound] = -1
}

public 
task_print_player(id)
{
    if(
is_user_connected(id -= TASK_PLAYER))
    {
        static 
szText[128]
        new 
formatex(szText127"%L"id"RF_PLAYER_PRINT")
        if(
get_pcvar_num(g_pcvarScore))
            
+= formatex(szText[n], 127 n" %L"id"RF_SCORE")
        if(
get_pcvar_num(g_pcvarMoney))
            
+= formatex(szText[n], 127 n" %L"id"RF_MONEY")
        
client_print_color(idDontChangeszText)
    }

Code:
[en]
RF_SPAWN = !g[Reconnect Features] !nYou can't spawn !gtwice in the same round !!
RF_PLAYER_PRINT = !g[Reconnect Features] !nDue to your retry, you have been restored :
RF_SCORE = - your !gscore
RF_MONEY = - your !gmoney
RF_ALL = %s used retry command :)
Cornor why all chat in green? and ML_NOT_FOUND?
__________________
Team-MMG CS1.6 Servers:
✅ MultiMod -- 103.179.44.152:27016
✅ Zombie Plague -- 103.179.44.152:27015
✅ Zombie Escape -- 103.179.44.152:27017
✅ Klassik Kombat -- 103.179.44.152:27018
✅ Boss-Battle -- 103.179.44.152:27019
yokomo 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 19:41.


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