Mhm, izproveju pec varda "prevmap" un atradu pluginu kas parada pedejas piecas kartes, bet ir velviena ficha! Kads zin ka nonemt lai cata neparadas texts ko uzrakstu lai redzetu vinu?
#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", szLastMapsFile, 63)
format(szLastMapsFile, 63, "%s/lastmaps.txt", szLastMapsFile)
new File = fopen(szLastMapsFile, "rt")
new i
new Temp[34]
if(File)
{
for(i=0; i<MAX_MAPS; i++)
{
if(!feof(File))
{
fgets(File, Temp, 33)
replace(Temp, 33, "^n", "")
formatex(g_MapNames, 33, Temp)
}
}
fclose(File)
}
delete_file(szLastMapsFile)
new CurrentMap[34]
get_mapname(CurrentMap, 33)
File = fopen(szLastMapsFile, "wt")
if(File)
{
formatex(Temp, 33, "%s^n", CurrentMap)
fputs(File, Temp)
for(i=0; i<MAX_MAPS-1; i++)
{
CurrentMap = g_MapNames
if(!CurrentMap[0])
break
formatex(Temp, 33, "%s^n", CurrentMap)
fputs(File, Temp)
}
fclose(File)
}
}
public lastmapsCmd(id) {
new LastMaps[256], n
n += formatex(LastMaps[n], 255-n, "Previous maps :")
for(new i; i<MAX_MAPS; i++)
{
if(!g_MapNames[0])
break
n += formatex(LastMaps[n], 255-n, "^n%s", g_MapNames)
}
client_print(id, print_console, LastMaps)
return PLUGIN_HANDLED
}
public lastmapsSayCmd(id) {
new LastMaps[192], n
n += formatex(LastMaps[n], 191-n, "Previous maps :")
for(new i; i<MAX_MAPS; i++)
{
if(!g_MapNames[0])
{
n += formatex(LastMaps[n-1], 191-n+1, ".")
break
}
n += formatex(LastMaps[n], 191-n, " %s%s", g_MapNames, i+1 == MAX_MAPS ? "." : ",")
}
client_print(id, print_chat, LastMaps)
return PLUGIN_CONTINUE
}