MadMakz
/
Misc-Tools
Archived
1
0
Fork 0
This repository has been archived on 2022-05-13. You can view files and clone it, but cannot push or open issues or pull requests.
Misc-Tools/SourcePawn/16k/16k.sp

46 lines
1.2 KiB
SourcePawn

#pragma semicolon 1
#include <sourcemod>
#define PLUGIN_VERSION "1.0.0"
#define PLUGIN_BUILD ""
#define PLUGIN_BUILD_DATE "01052009"
public Plugin:myinfo =
{
name = "16k - RoundMoney",
author = "MadMakz (Cyber Games X24)",
description = "Set the players money amount for each round/spawn",
version = PLUGIN_VERSION,
url = "http://cgx24.com"
};
new Handle:OnOff;
new Handle:DoAmount;
new g_iAccount = -1;
public OnPluginStart()
{
g_iAccount = FindSendPropOffs("CCSPlayer", "m_iAccount");
CreateConVar("16k_version", PLUGIN_VERSION, "16k - RoundMoney version", FCVAR_PLUGIN|FCVAR_REPLICATED|FCVAR_NOTIFY);
OnOff = CreateConVar("16k_enable","1","1 on 0 off");
DoAmount = CreateConVar("16k_amount","16000","How much money to set on player_spawn?");
HookEvent("player_spawn", Spawn);
}
public Spawn(Handle: event , const String: name[] , bool: dontBroadcast)
{
new clientID = GetEventInt(event,"userid");
new client = GetClientOfUserId(clientID);
if(GetConVarInt(OnOff))
{
SetMoney(client,GetConVarInt(DoAmount));
}
}
public SetMoney(client, amount)
{
if (g_iAccount != -1)
{
SetEntData(client, g_iAccount, amount);
}
}