forked from Bara/cscoUpdate
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdescription.sp
More file actions
40 lines (33 loc) · 857 Bytes
/
description.sp
File metadata and controls
40 lines (33 loc) · 857 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#pragma semicolon 1
#include <sourcemod>
#include <SteamWorks>
#pragma newdecls required
ConVar g_cName = null;
public Plugin myinfo =
{
name = "[CSCO] - Description",
author = "Bara",
description = "",
version = "1.0.0",
url = "github.com/Bara20"
};
public void OnPluginStart()
{
g_cName = CreateConVar("csco_game_description", "Classic Offensive", "Sets the game description (Default: Counter-Strike: Classic Offensive)");
g_cName.AddChangeHook(CVAR_ChangeHook);
}
public void CVAR_ChangeHook(ConVar convar, const char[] oldValue, const char[] newValue)
{
if(convar == g_cName)
{
char sBuffer[128];
strcopy(sBuffer, sizeof(sBuffer), newValue);
SteamWorks_SetGameDescription(sBuffer);
}
}
public void OnConfigsExecuted()
{
char sBuffer[128];
g_cName.GetString(sBuffer, sizeof(sBuffer));
SteamWorks_SetGameDescription(sBuffer);
}