Raised This Month: $ Target: $400
 0% 

[SOLVED] How to add colorchat to this ?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
T-z3P
Senior Member
Join Date: Apr 2008
Location: Iasi, Romania
Old 04-04-2011 , 15:09   [SOLVED] How to add colorchat to this ?
Reply With Quote #1

Hi . How to add colorchat to this ?

Something like this (the red text is team-color) :
Code:
Last maps played are: fy_dust, fy_snow, de_dust2, de_nuke, cs_italy
PHP Code:
#include <amxmodx>

#define MAX_MAPS    5

new g_MapNames[MAX_MAPS][34]

public 
plugin_init() 
{
    
register_plugin("last played maps""0.2""ConnorMcLeod")
    
register_clcmd("amx_lastmaps""lastmapsCmd")
    
register_clcmd("say /lastmaps""lastmapsSayCmd")
}

public 
plugin_cfg() 
{
    new 
szLastMapsFile[64]
    
    
get_localinfo("amxx_configsdir"szLastMapsFile63)
    
format(szLastMapsFile63"%s/lastmaps.txt"szLastMapsFile)

    new 
File fopen(szLastMapsFile"rt")
    new 
i
    
new Temp[34]
    if(
File)
    {
        for(
i=0i<MAX_MAPSi++)
        {
            if(!
feof(File))
            {
                
fgets(FileTemp33)
                
replace(Temp33"^n""")
                
formatex(g_MapNames[i], 33Temp)
            }
        }
        
fclose(File)
    }

    
delete_file(szLastMapsFile)

    new 
CurrentMap[34]
    
get_mapname(CurrentMap33)

    
File fopen(szLastMapsFile"wt")
    if(
File)
    {
        
formatex(Temp33"%s^n"CurrentMap)
        
fputs(FileTemp)
        for(
i=0i<MAX_MAPS-1i++)
        {
            
CurrentMap g_MapNames[i]
            if(!
CurrentMap[0])
                break
            
formatex(Temp33"%s^n"CurrentMap)
            
fputs(FileTemp)
            
// ?? fprintf
        
}
        
fclose(File)
    }
}

public 
lastmapsCmd(id
{
    new 
LastMaps[256], n
    n 
+= formatex(LastMaps[n], 255-n"Last maps played are :")
    for(new 
ii<MAX_MAPSi++)
    {
        if(!
g_MapNames[i][0])
            break
        
+= formatex(LastMaps[n], 255-n"^n%s"g_MapNames[i])
    }
    
client_print(idprint_consoleLastMaps)
    return 
PLUGIN_HANDLED
}

public 
lastmapsSayCmd(id
{
    new 
LastMaps[192]
    new 
formatex(LastMaps[n], 191-n"Last maps played are :")
    for(new 
ii<MAX_MAPSi++)
    {
        if(!
g_MapNames[i][0])
        {
            
+= formatex(LastMaps[n-1], 191-n+1".")
            break
        }
        
+= formatex(LastMaps[n], 191-n" %s%s"g_MapNames[i], i+== MAX_MAPS "." ",")
    }
    
client_print(idprint_chatLastMaps)
    return 
PLUGIN_CONTINUE

__________________



Last edited by T-z3P; 04-05-2011 at 10:50.
T-z3P is offline
Send a message via Yahoo to T-z3P Send a message via Skype™ to T-z3P
 


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 14:29.


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