Salut, am tot schimbat pluginu`l asta pana mi-a iesit pe ochii.
cand dau /harti se repeta hartile gen: fy_snow fy_snow dust2 dust2 infeno
Si ele au fost doar odata, oare cum pot rezolva asta ?
Se repeta hartile la plugin-ul /harti
Moderators: Moderatori ajutatori, Moderatori, Echipa eXtreamCS.com
- cyby
- Scripter eXtreamCS
- Posts: 1777
- Joined: 16 Jul 2011, 21:46
- Detinator Steam: Da
- Detinator server CS: Da
- Reputatie: Scripter eXtreamCS
Fost Moderator ajutator - Has thanked: 146 times
- Been thanked: 396 times
Verifica asta:
Code: Select all
#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[i], 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[i]
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, "Ultimele harti jucate :")
for(new i; i<MAX_MAPS; i++)
{
if(!g_MapNames[i][0])
break
n += formatex(LastMaps[n], 255-n, "^n%s", g_MapNames[i])
}
client_print(id, print_console, LastMaps)
return PLUGIN_HANDLED
}
public lastmapsSayCmd(id) {
new LastMaps[192], n
n += formatex(LastMaps[n], 191-n, "Ultimele harti jucate :")
for(new i; i<MAX_MAPS; i++)
{
if(!g_MapNames[i][0])
{
n += formatex(LastMaps[n-1], 191-n+1, ".")
break
}
n += formatex(LastMaps[n], 191-n, " %s%s", g_MapNames[i], i+1 == MAX_MAPS ? "." : ",")
}
client_print(id, print_chat, LastMaps)
return PLUGIN_CONTINUE
}
93.114.82.17:27015 - Monster Invasion CO-OP Mod