Skip to content

Commit a6b4f06

Browse files
committed
Credits
1 parent bc84781 commit a6b4f06

1 file changed

Lines changed: 38 additions & 0 deletions

File tree

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#pragma semicolon 1
2+
#pragma newdecls required
3+
#include <sourcemod>
4+
#include <shopsms>
5+
6+
#define CREDITS_BY_NATIVE -1
7+
8+
/**
9+
* Gives certain amount of credits to the player
10+
* -
11+
* @param client Client index
12+
* @param amount Amount to give
13+
* @param by_who Optional param to set by who the credits being given from
14+
* -
15+
* @return New amount of credits
16+
*/
17+
native int Shop_GiveClientCredits(int client, int amount, int by_who = CREDITS_BY_NATIVE);
18+
19+
#define SERVICE_ID "credits"
20+
21+
public Plugin myinfo =
22+
{
23+
name = "Shop SMS: Service: Credits",
24+
author = "SeeK",
25+
description = "ShopSMS's extension that allow players to purchase credits.",
26+
version = VERSION,
27+
url = "https://www.sklep-sms.pl/"
28+
};
29+
30+
public void OnPluginStart()
31+
{
32+
ShopRegisterService(SERVICE_ID);
33+
}
34+
35+
public void ShopServicePurchased(int client, int quantity)
36+
{
37+
Shop_GiveClientCredits(client, quantity);
38+
}

0 commit comments

Comments
 (0)