-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathsupplypoint.sp
41 lines (32 loc) · 1.04 KB
/
supplypoint.sp
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
41
#pragma semicolon 1
#pragma newdecls required
#include <smutils>
#include <sdkhooks>
public Plugin myinfo =
{
name = "More supply point",
author = "Kyle",
description = "<- description ->",
version = "1.0",
url = "https://www.kxnrl.com"
};
#define SUPPLY 50
public APLRes AskPluginLoad2(Handle myself, bool late, char[] error, int err_max)
{
RegPluginLibrary("Insurgency-SupplyPoint");
return APLRes_Success;
}
public void OnPluginStart()
{
// Supply
HookEvent("player_spawn", Event_Supply, EventHookMode_Post);
HookEvent("player_death", Event_Supply, EventHookMode_Post);
HookEvent("player_team", Event_Supply, EventHookMode_Post);
}
public void Event_Supply(Event e, const char[] name, bool db)
{
int client = GetClientOfUserId(e.GetInt("userid"));
int Tokens = GetEntProp(client, Prop_Send, "m_nRecievedTokens");
SetEntProp(client, Prop_Send, "m_nRecievedTokens", SUPPLY);
PrintToConsole(client, "[More Supply Point] Earned %d supply points. [O: %d]", SUPPLY, Tokens);
}