Raised This Month: $32 Target: $400
 8% 

Solved help copiler


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
cosminvl
Member
Join Date: Mar 2013
Location: Romania
Old 02-15-2019 , 16:52   help copiler
Reply With Quote #1

someone help me please
PHP Code:
#include <amxmodx>
#include <colorchat>

#define PLUGIN_VERSION "1.0"

new g_szMessage[256]

new 
g_pTimeleftg_pThetimeg_pNextmapg_pCurrentmap
new g_pTimeleftMsgg_pThetimeMsgg_pNextmapMsgg_pCurrentmapMsg

new const g_szReplaceColors[][] = { "!g""^x04""!t""^x03""!y""^x01" }

public 
plugin_init()
{
    
register_plugin("Simple Timeleft and Nextmap [Colored Messages]"PLUGIN_VERSION"Unbr3akable")
    
register_cvar("SimpleTimeleftNextmap"PLUGIN_VERSIONFCVAR_SERVER|FCVAR_SPONLY|FCVAR_UNLOGGED)
    
    
g_pTimeleft =         register_cvar("enable_timeleft""1")
    
g_pThetime =        register_cvar("enable_thetime""1")
    
g_pNextmap =        register_cvar("enable_nextmap""1")
    
g_pCurrentmap =        register_cvar("enable_currentmap""1")
    
    
g_pTimeleftMsg =    register_cvar("timeleft_message""!t[!gTimeleft!t] !yTime remaining: !t<timeleft>")
    
g_pThetimeMsg =     register_cvar("thetime_message""!t[!gThetime!t] !yThe time is: !t<thetime>")
    
g_pNextmapMsg =        register_cvar("nextmap_message""!t[!gNextmap!t] !yNext map is: !t<nextmap>")
    
g_pCurrentmapMsg =    register_cvar("currentmap_message""!t[!gCurrentmap!t] !yCurrent map is: !t<currentmap>")
    
    
register_clcmd("say /timeleft""Show_Timeleft")
    
register_clcmd("say /thetime""Show_Thetime")
    
register_clcmd("say /nextmap""Show_Nextmap")
    
register_clcmd("say /currentmap""Show_Currentmap")
}

public 
Show_Timeleft(id)
{
    new 
szText[256]
    
    new 
iTimeleft get_timeleft(), iMinutes iTimeleft 60iSeconds iTimeleft 60
    formatex
(szTextcharsmax(szText), "%i:%i"iMinutesiSeconds)
    
get_pcvar_string(g_pTimeleftMsgg_szMessagecharsmax(g_szMessage))
    
    for(new 
0sizeof(g_szReplaceColors) - 1+= 2)
        
replace_all(g_szMessagecharsmax(g_szMessage), g_szReplaceColors[i], g_szReplaceColors[1])
        
    
replace(g_szMessagecharsmax(g_szMessage), "<timeleft>"szText)
    
    if(
get_pcvar_num(g_pTimeleft))
        
ColorChat(idTEAM_COLOR"%s"g_szMessage)
    
    return 
PLUGIN_HANDLED
}

public 
Show_Thetime(id)
{
    new 
iTheTime[32]
    
    
get_time("%m/%d/%Y - %H:%M:%S"iTheTimecharsmax(iTheTime))
    
get_pcvar_string(g_pThetimeMsgg_szMessagecharsmax(g_szMessage))
    
    for(new 
0sizeof(g_szReplaceColors) - 1+= 2)
        
replace_all(g_szMessagecharsmax(g_szMessage), g_szReplaceColors[i], g_szReplaceColors[1])
    
    
replace(g_szMessagecharsmax(g_szMessage), "<thetime>"iTheTime)
    
    if(
get_pcvar_num(g_pThetime))
        
ColorChat(idTEAM_COLOR"%s"g_szMessage)
    
    return 
PLUGIN_HANDLED
}

public 
Show_Nextmap(id)
{
    new 
szNextMap[32]
    
    
get_cvar_string("amx_nextmap"szNextMapcharsmax(szNextMap))
    
get_pcvar_string(g_pNextmapMsgg_szMessagecharsmax(g_szMessage))
    
    for(new 
0sizeof(g_szReplaceColors) - 1+= 2)
        
replace_all(g_szMessagecharsmax(g_szMessage), g_szReplaceColors[i], g_szReplaceColors[1])
        
    
replace(g_szMessagecharsmax(g_szMessage), "<nextmap>"szNextMap)
    
    if(
get_pcvar_num(g_pNextmap))
        
ColorChat(idTEAM_COLOR"%s"g_szMessage)
    
    return 
PLUGIN_HANDLED
}

public 
Show_Currentmap(id)
{
    new 
szCurMap[32]
    
    
get_mapname(szCurMapcharsmax(szCurMap))
    
get_pcvar_string(g_pCurrentmapMsgg_szMessagecharsmax(g_szMessage))
    
    for(new 
0sizeof(g_szReplaceColors) - 1+= 2)
        
replace_all(g_szMessagecharsmax(g_szMessage), g_szReplaceColors[i], g_szReplaceColors[1])
        
    
replace(g_szMessagecharsmax(g_szMessage), "<currentmap>"szCurMap)
    
    if(
get_pcvar_num(g_pCurrentmap))
        
ColorChat(idTEAM_COLOR"%s"g_szMessage)
    
    return 
PLUGIN_HANDLED
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1026\\ f0\\ fs16 \n\\ par }
*/ 
__________________



Last edited by cosminvl; 02-22-2019 at 16:53.
cosminvl is offline
Send a message via Yahoo to cosminvl
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 02-15-2019 , 18:13   Re: help copiler
Reply With Quote #2

Help with what?!
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
HiDeath
Senior Member
Join Date: Aug 2018
Location: Tunisia
Old 02-16-2019 , 11:31   Re: help copiler
Reply With Quote #3

amx stats already do that
HiDeath is offline
Reply


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 23:51.


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