Repo: https://github.com/SourceTurk/swgm-module/tree/master/scripting
Kod:
#include <sourcemod>
#include <cstrike>
#include <sdktools>
#include <2SteamWorks>
#include <SWGM>
#include <multicolors>
#pragma semicolon 1
#pragma newdecls required
Handle RoundStartMoney;
ConVar g_groupmessage;
int iRoundStartMoney;
public Plugin myinfo =
{
name = "Round start money",
author = "northeaster",
description = "eski nickim lazhoroni ile github'a ilk olarak kaydedilmiştir. swgm 1.7 için yapılmıştır.",
version = "1.0.2",
url = "https://forum.sourceturk.net"
};
public void OnPluginStart()
{
HookEvent("round_start", OnRoundStart);
RoundStartMoney = CreateConVar("swgm_round_start_money", "650", "Round start money");
g_groupmessage = CreateConVar("swgm_round_start_chat_message", "1", "0 = Disable, 1 = Enable", 0, true, 0.0, true, 1.0);
AutoExecConfig(true, "swgm_round_start_money");
LoadTranslations("swgm_round_start_money.phrases");
}
public void OnMapStart()
{
iRoundStartMoney = GetConVarInt(RoundStartMoney);
}
public Action OnRoundStart(Handle hEvent, const char[] Name, bool dontbroadcast)
{
if (GameRules_GetProp("m_bWarmupPeriod") != 0)
{
return;
}
for (int iClient = 1; iClient <= MaxClients; iClient++)
{
if(IsClientInGame(iClient) && !IsFakeClient(iClient))
{
if (IsRoundBlah(GetCurrentRound()))
{
if(!SWGM_InGroup(iClient))
{
if (g_groupmessage.IntValue == 1)
{
CPrintToChat(iClient, "%t", "Message 1", iRoundStartMoney);
CPrintToChat(iClient, "%t", "Message 2");
}
}
else if(SWGM_InGroup(iClient))
{
if (g_groupmessage.IntValue == 1)
{
CPrintToChat(iClient, "%t", "Message 3", iRoundStartMoney);
}
SetEntProp(iClient, Prop_Send, "m_bHasHelmet", 100);
SetEntProp(iClient, Prop_Send, "m_ArmorValue", 100);
int money = GetEntProp(iClient, Prop_Send, "m_iAccount");
money = money + iRoundStartMoney;
Handle maxmoney = FindConVar("mp_maxmoney");
if (money > GetConVarInt(maxmoney))
{
money = GetConVarInt(maxmoney);
}
SetEntProp(iClient, Prop_Send, "m_iAccount", money);
}
}
else
{
if(!SWGM_InGroup(iClient))
{
if (g_groupmessage.IntValue == 1)
{
CPrintToChat(iClient, "%t", "Message 1", iRoundStartMoney);
CPrintToChat(iClient, "%t", "Message 2");
}
}
else if(SWGM_InGroup(iClient))
{
if (g_groupmessage.IntValue == 1)
{
CPrintToChat(iClient, "%t", "Message 4", iRoundStartMoney);
}
}
}
}
}
}
bool IsRoundBlah(int iRound)
{
return iRound != 1 && iRound != 2 && iRound != 3 && iRound != 16 && iRound != 17 && iRound != 18;
}
int GetCurrentRound()
{
return CS_GetTeamScore(CS_TEAM_T) + CS_GetTeamScore(CS_TEAM_CT) + 1;
})

