Check this:
https://forums.alliedmods.net/showpo...18&postcount=3
And Last 5 maps edit by me
PHP Code:
#pragma semicolon 1
#include <sourcemod>
public Plugin:myinfo =
{
name = "Map History",
author = "Gweedo",
description = "Tracks the recently played maps",
version = "1.0",
url = "http://www.themrclan.net"
}
new Handle:g_MapArray = INVALID_HANDLE;
public OnPluginStart(){
RegAdminCmd("sm_maphistory", Command_History, ADMFLAG_GENERIC);
g_MapArray = CreateArray(32);
}
public OnMapEnd(){
new String:map[64];
GetCurrentMap(map,sizeof(map));
PushArrayString(g_MapArray,map);
if (GetArraySize(g_MapArray) > 4)
RemoveFromArray(g_MapArray,0);
}
public OnPluginEnd(){
CloseHandle(g_MapArray);
}
public Action:Command_History(client, args){
if (args != 0){
ReplyToCommand(client, "[SM] No arguements for this command");
return Plugin_Handled;
}
if (g_MapArray != INVALID_HANDLE){
new MapArray = GetArraySize(g_MapArray)-1;
new MapLabel = MapArray+2;
for (new i=0; i<=MapArray; i++){
new String:map[64];
GetArrayString(g_MapArray,i,map,sizeof(map));
PrintToConsole(client, "%i. %s", MapLabel, map);
MapLabel--;
}
}
new String:currentMap[64];
GetCurrentMap(currentMap,sizeof(currentMap));
PrintToConsole(client, "1. %-24s Current map", currentMap);
return Plugin_Handled;
}
__________________