Raised This Month: $ Target: $400
 0% 

[SOLVED] How to add colorchat to this ?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 04-05-2011 , 01:29   Re: [HELP] How to add colorchat to this ?
Reply With Quote #5

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

#define MAX_MAPS    5

new g_szMapNames[MAX_MAPS][32]

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

public 
plugin_cfg() 
{
    new 
szLastMapsFile[64]

    
get_localinfo("amxx_configsdir"szLastMapsFilecharsmax(szLastMapsFile))
    
add(szLastMapsFilecharsmax(szLastMapsFile), "/lastmaps.txt")

    new 
File fopen(szLastMapsFile"rt")
    new 
i
    
new szTemp[32]
    if(
File)
    {
        for(
i=0i<MAX_MAPSi++)
        {
            if(!
feof(File))
            {
                
fgets(FileszTempcharsmax(szTemp))
                
trim(szTemp)
                
formatex(g_szMapNames[i], charsmax(g_szMapNames[]), szTemp)
            }
        }
        
fclose(File)
    }

    new 
szCurrentMap[32]
    
get_mapname(szCurrentMapcharsmax(szCurrentMap))

    
File fopen(szLastMapsFile"wt")
    if(
File)
    {
        
fprintf(File"%s^n"szCurrentMap)
        for(
i=0i<MAX_MAPS-1i++)
        {
            if( !
copy(szCurrentMapcharsmax(szCurrentMap), g_szMapNames[i]) )
            {
                break
            }
            
fprintf(File"%s^n"szCurrentMap)
        }
        
fclose(File)
    }
}

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

public 
lastmapsSayCmd(id
{
    new 
LastMaps[192]
    new 
formatex(LastMapscharsmax(LastMaps), "^4Last maps played are :^3")
    for(new 
ii<MAX_MAPSi++)
    {
        if(!
g_szMapNames[i][0])
        {
            
LastMaps[--n] = '.'
            
break
        }
        
+= formatex(LastMaps[n], charsmax(LastMaps)-n" %s%c"g_szMapNames[i], i+== MAX_MAPS '.' ',')
    }
    
client_print_color(idDontChangeLastMaps)
    return 
PLUGIN_CONTINUE

__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
 



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