Skip to content

Commit

Permalink
Credits
Browse files Browse the repository at this point in the history
  • Loading branch information
budziam committed Jun 16, 2021
1 parent 736ea15 commit 1715161
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions scripting/shopsms_service_credits.sp
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#pragma semicolon 1
#pragma newdecls required
#include <sourcemod>
#include <shopsms>

#define CREDITS_BY_NATIVE -1

/**
* Gives certain amount of credits to the player
* -
* @param client Client index
* @param amount Amount to give
* @param by_who Optional param to set by who the credits being given from
* -
* @return New amount of credits
*/
native int Shop_GiveClientCredits(int client, int amount, int by_who = CREDITS_BY_NATIVE);

#define SERVICE_ID "credits"

public Plugin myinfo =
{
name = "Shop SMS: Service: Credits",
author = "SeeK",
description = "ShopSMS's extension that allow players to purchase credits.",
version = VERSION,
url = "https://www.sklep-sms.pl/"
};

public void OnPluginStart()
{
ShopRegisterService(SERVICE_ID);
}

public void ShopServicePurchased(int client, int quantity)
{
Shop_GiveClientCredits(client, quantity);
}

0 comments on commit 1715161

Please sign in to comment.