Adding FakeMapname
This commit is contained in:
parent
f6b8c2786b
commit
6ca0d5dd70
65
FakeMapname/scripting/FakeMapname.sp
Normal file
65
FakeMapname/scripting/FakeMapname.sp
Normal file
@ -0,0 +1,65 @@
|
||||
#include <sourcemod>
|
||||
#include <SteamWorks>
|
||||
|
||||
#pragma semicolon 1
|
||||
#pragma newdecls required
|
||||
|
||||
char g_sMapname[64];
|
||||
|
||||
public Plugin myinfo =
|
||||
{
|
||||
name = "FakeMapname",
|
||||
author = "Neon",
|
||||
description = "",
|
||||
version = "1.0",
|
||||
url = "https://steamcommunity.com/id/n3ontm"
|
||||
};
|
||||
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
// Purpose:
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
public void OnGameFrame()
|
||||
{
|
||||
SteamWorks_SetMapName(g_sMapname);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
// Purpose:
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
public void OnPluginStart()
|
||||
{
|
||||
RegAdminCmd("sm_fakemap", Command_FakeMap, ADMFLAG_ROOT, "");
|
||||
RegAdminCmd("sm_resetfakemap", Command_ResetFakeMap, ADMFLAG_ROOT, "");
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
// Purpose:
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
public void OnMapStart()
|
||||
{
|
||||
GetCurrentMap(g_sMapname, sizeof(g_sMapname));
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
// Purpose:
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
public Action Command_FakeMap(int client, int argc)
|
||||
{
|
||||
GetCmdArgString(g_sMapname, sizeof(g_sMapname));
|
||||
ReplyToCommand(client, "[SM] Changed Mapname to \"%s\".", g_sMapname);
|
||||
PrintToChatAll("[SM] %N changed Mapname to \"%s\".", client, g_sMapname);
|
||||
LogAction(client, -1, "\"%L\" changed Mapname to \"%s\".", client, g_sMapname);
|
||||
return Plugin_Handled;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
// Purpose:
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
public Action Command_ResetFakeMap(int client, int argc)
|
||||
{
|
||||
GetCurrentMap(g_sMapname, sizeof(g_sMapname));
|
||||
ReplyToCommand(client, "[SM] Mapname got reset.");
|
||||
PrintToChatAll("[SM] %N reset Mapname to \"%s\".", client, g_sMapname);
|
||||
LogAction(client, -1, "\"%L\" reset Mapname to \"%s\".", client, g_sMapname);
|
||||
return Plugin_Handled;
|
||||
}
|
Loading…
Reference in New Issue
Block a user