It prints the text when the task is comming up, but it doesnt show the nextmaps name where NEXT_MAP (( why ?
Code:
#include <amxmodx>
new CurrentTime[9]
new g_nextMap[32]
#define TASK_ID_CHECKFORMAPEND 241
public plugin_init()
{
register_plugin("Kartes Beigu Teksts", "0.1 b3ta" ,"ZerroQ")
set_task(15.0,"Task_MapEnd",TASK_ID_CHECKFORMAPEND,_,_,"d",1)
}
getNextMapName(szArg[], iMax)
{
new len = get_cvar_string("amx_nextmap", szArg, iMax)
if (is_map_valid(szArg)) return len
len = copy(szArg, iMax, g_nextMap)
set_cvar_string("amx_nextmap", g_nextMap)
return len
}
public Task_MapEnd()
{
if(get_playersnum())
{
client_print(0,print_chat,"[CS.Boldnet] Kartes laika limits iztecejis.")
get_time("%H:%M:%S",CurrentTime,8)
get_mapname("name[0]",10)
client_print(0,3,"[CS.Boldnet] Pareizs Laiks ir: %s",CurrentTime)
new name[32]
getNextMapName(name, 31)
client_print(0,3,"[CS.Boldnet] Sekojosa karte bus: NEXT_MAP ",name)
engclient_print(0,engprint_center, "Pateicamies, ka spelejat!^nUzgaidiet lidz ieladejas NEXT_MAP",name)
client_print(0,3,"[CS.Boldnet] Pieversies musu web portalinam: http://cs.boldnet.lv")
}
}
__________________