name = "[CSGO] Warmup Money",
description = "Gives money to players when after their spawn during warmup",
url = "https://steamcommunity.com/groups/grey83ds"
public void OnPluginStart()
if(GetEngineVersion() != Engine_CSGO)
SetFailState("Plugin for CS:GO only!");
if((g_iAccount = FindSendPropInfo("CCSPlayer", "m_iAccount")) < 1)
SetFailState("Can't find 'm_iAccount' offset!");
(CVar = CreateConVar("sm_warmupmoney", "16000", "How much money will players receive after spawn during the warmup.\nx<800 - plugin diabled", FCVAR_NOTIFY, true, _, true, 16000.0)).AddChangeHook(CVarChanged);
if((iMoney = CVar.IntValue) < 800) iMoney = 0;
HookEvent("round_start", Event_Start);
public void CVarChanged(ConVar CVar, const char[] oldValue, const char[] newValue)
if((iMoney = CVar.IntValue) < 800) iMoney = 0;
public void Event_Start(Event event, const char[] name, bool dontBroadcast)
if(hooked == (GameRules_GetProp("m_bWarmupPeriod") != 0))
HookEvent("player_spawn", Event_Spawn, EventHookMode_Pre);
UnhookEvent("player_spawn", Event_Spawn, EventHookMode_Pre);
if(!cv && !(cv = FindConVar("mp_startmoney"))) return;
for(int i = 1, money = cv.IntValue; i <= MaxClients; i++) if(IsClientInGame(i) && GetClientTeam(i) > 1)
SetEntData(i, g_iAccount, money);
public void Event_Spawn(Event event, const char[] name, bool dontBroadcast)
if(!iMoney && (client = GetClientOfUserId(event.GetInt("userid"))) && GetClientTeam(client) > 1)
SetEntData(client, g_iAccount, iMoney);