Skip to content
This repository has been archived by the owner on May 8, 2023. It is now read-only.

Commit

Permalink
Merge pull request #3 from domikuss/dev
Browse files Browse the repository at this point in the history
Update to 2.1.0
  • Loading branch information
domikuss authored Feb 10, 2023
2 parents 6dd7222 + bf9487b commit 479419e
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 5 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
## Release Notes

## [2.1.0]

### Innovations:

- Shop Gold support added.

### Configuration file:

- Added two new keys "shop_gold_price" and "shop_gold_sellprice" responsible for the price of items and their selling in the currency of Gold.

## [2.0.2]

### Fixes:
Expand Down
10 changes: 10 additions & 0 deletions configs/killscreen.ini
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@
"shop" "1" // Добавлять в Shop. Add to Shop.
"shop_description" "dark_blink_description" // Описание товара в Shop. Description in Shop.
"shop_price" "1000" // Цена в Shop. Price at Shop.
"shop_gold_price" "0" // Цена в Shop Gold. Price at Shop.
"shop_sellprice" "500" // Цена для продажи. Price for sale
"shop_gold_sellprice" "0" // Цена для продажи в Shop Gold. Price for sale on Shop Gold
"shop_duration" "86400" // Длительность товара. Product Duration.
"shop_luckchance" "50" // Шанс выпадения. Chance of falling out.
"shop_hide" "0" // Сделать недоступным для покупки. (Можно выдать через меню администратора, или получить, испытав удачу)
Expand All @@ -44,7 +46,9 @@
"shop" "1"
"shop_description" "pretty_red_description"
"shop_price" "1000"
"shop_gold_price" "0"
"shop_sellprice" "500"
"shop_gold_sellprice" "0"
"shop_duration" "86400"
"shop_luckchance" "50"
"shop_hide" "0"
Expand All @@ -66,7 +70,9 @@
"shop" "1"
"shop_description" "healthshot_description"
"shop_price" "1000"
"shop_gold_price" "0"
"shop_sellprice" "500"
"shop_gold_sellprice" "0"
"shop_duration" "86400"
"shop_luckchance" "50"
"shop_hide" "0"
Expand All @@ -88,7 +94,9 @@
"shop" "1"
"shop_description" "simple_blue_description"
"shop_price" "1000"
"shop_gold_price" "0"
"shop_sellprice" "500"
"shop_gold_sellprice" "0"
"shop_duration" "86400"
"shop_luckchance" "50"
"shop_hide" "0"
Expand All @@ -110,7 +118,9 @@
"shop" "1"
"shop_description" "typical_grey_description"
"shop_price" "1000"
"shop_gold_price" "0"
"shop_sellprice" "500"
"shop_gold_sellprice" "0"
"shop_duration" "86400"
"shop_luckchance" "50"
"shop_hide" "0"
Expand Down
14 changes: 13 additions & 1 deletion scripting/kill_screen/config.sp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ int g_iIgnoreLevel;
#define CONFIG_DEFAULT_SHOP_DESCRIPTION ""
#define CONFIG_DEFAULT_SHOP_PRICE 0
#define CONFIG_DEFAULT_SHOP_SELLPRICE 0
#define CONFIG_DEFAULT_SHOP_GOLD_PRICE 0
#define CONFIG_DEFAULT_SHOP_GOLD_SELLPRICE 0
#define CONFIG_DEFAULT_SHOP_DURATION 86400
#define CONFIG_DEFAULT_SHOP_LUCKCHANCE - 0
#define CONFIG_DEFAULT_SHOP_HIDE false
Expand Down Expand Up @@ -110,7 +112,7 @@ void DistributeItems()
#if defined SHOP_INCLUDED
if(HasFlag(g_EPluginStatus, EPluginStatus_Shop_Loaded) && !(HasFlag(g_EPluginStatus, EPluginStatus_Shop_Config_Parsed)) && g_ParseKillScreen.AddToShop)
{
AddShopItem(i, g_ParseKillScreen.Name, g_ParseKillScreen.ShopData.Description, g_ParseKillScreen.ShopData.Price, g_ParseKillScreen.ShopData.SellPrice, g_ParseKillScreen.ShopData.Duration, g_ParseKillScreen.ShopData.LuckChance, g_ParseKillScreen.ShopData.Hide);
AddShopItem(i, g_ParseKillScreen.Name, g_ParseKillScreen.ShopData.Description, g_ParseKillScreen.ShopData.Price, g_ParseKillScreen.ShopData.SellPrice, g_ParseKillScreen.ShopData.GoldPrice, g_ParseKillScreen.ShopData.GoldSellPrice, g_ParseKillScreen.ShopData.Duration, g_ParseKillScreen.ShopData.LuckChance, g_ParseKillScreen.ShopData.Hide);
}
#endif
}
Expand Down Expand Up @@ -170,6 +172,8 @@ SMCResult Config_NewSection(SMCParser hParser, const char[] sName, bool bInQuote
g_ParseKillScreen.ShopData.Description = CONFIG_DEFAULT_SHOP_DESCRIPTION;
g_ParseKillScreen.ShopData.Price = CONFIG_DEFAULT_SHOP_PRICE;
g_ParseKillScreen.ShopData.SellPrice = CONFIG_DEFAULT_SHOP_SELLPRICE;
g_ParseKillScreen.ShopData.GoldPrice = CONFIG_DEFAULT_SHOP_GOLD_PRICE;
g_ParseKillScreen.ShopData.GoldSellPrice = CONFIG_DEFAULT_SHOP_GOLD_SELLPRICE;
g_ParseKillScreen.ShopData.Duration = CONFIG_DEFAULT_SHOP_DURATION;
g_ParseKillScreen.ShopData.LuckChance = CONFIG_DEFAULT_SHOP_LUCKCHANCE;
g_ParseKillScreen.ShopData.Hide = CONFIG_DEFAULT_SHOP_HIDE;
Expand Down Expand Up @@ -260,6 +264,14 @@ SMCResult Config_KeyValue(SMCParser hParser, const char[] sKey, const char[] sV
{
g_ParseKillScreen.ShopData.SellPrice = StringToInt(sValue);
}
else if(strcmp(sKey, "shop_gold_price") == 0)
{
g_ParseKillScreen.ShopData.GoldPrice = StringToInt(sValue);
}
else if(strcmp(sKey, "shop_gold_sellprice") == 0)
{
g_ParseKillScreen.ShopData.GoldSellPrice = StringToInt(sValue);
}
else if(strcmp(sKey, "shop_duration") == 0)
{
g_ParseKillScreen.ShopData.Duration = StringToInt(sValue);
Expand Down
6 changes: 3 additions & 3 deletions scripting/kill_screen/shop.sp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public void Shop_Started()
}
}

void AddShopItem(int iIndex, const char[] sName, const char[] sDescription, int iPrice, int iSellPrice, int iDuration, int iLuckChance, bool bHide)
void AddShopItem(int iIndex, const char[] sName, const char[] sDescription, int iPrice, int iSellPrice, int iGoldPrice, int iGoldSellPrice, int iDuration, int iLuckChance, bool bHide)
{
if(g_iCategoryId == INVALID_CATEGORY)
{
Expand All @@ -21,8 +21,8 @@ void AddShopItem(int iIndex, const char[] sName, const char[] sDescription, int

if(Shop_StartItem(g_iCategoryId, sName))
{
Shop_SetInfo(sName, sDescription, iPrice, iSellPrice, Item_Togglable, iDuration);
if(iPrice <= 0 || bHide)
Shop_SetInfo(sName, sDescription, iPrice, iSellPrice, Item_Togglable, iDuration, iGoldPrice, iGoldSellPrice);
if((iPrice <= 0 && iGoldPrice <= 0) || bHide)
{
Shop_SetHide(true);
}
Expand Down
4 changes: 3 additions & 1 deletion scripting/killscreen.sp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,9 @@ enum EPlayerStatus
{
char Description[SHOP_MAX_STRING_LENGTH];
int Price;
int GoldPrice;
int SellPrice;
int GoldSellPrice;
int Duration;
int LuckChance;
bool Hide;
Expand Down Expand Up @@ -143,7 +145,7 @@ Handle g_hCookie;
#define NORMAL_COOKIE_CHAR 'n'
static const int g_iSource[] = {'\0', VIP_COOKIE_CHAR, '\0', NORMAL_COOKIE_CHAR};

#define PLUGIN_VERSION "2.0.2"
#define PLUGIN_VERSION "2.1.0"

#define DEBUG_LEVEL 0

Expand Down

0 comments on commit 479419e

Please sign in to comment.