-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can you convert this Shop Core plugin to Zephyrus Store? i want to add buy vip core to this shop #154
Comments
And in Items.txt, something like this "BuyVip" |
Hi, please test my PR. "VIP - 1 week" |
in the VIP_Remove() function i think before because if the client sold, traded the item the vip status won't get removed. also in VIP_Equip() the duration of the vip should be based on the remaining time of the store item if its not removed from store PS: BTW Thank you so much for doing this |
As far as i remember, you can't sell/trade the item, as it disappears from your inventory as soon as you equip it. --> Store_RemoveItem(client, id); In VIP_Equip() i don't know what you want, the duration is based on the "time" which is in the CFG, u can add for 2 weeks, 1 month, 6 months, etc.. just need to edit the "time". or u want same as u send, in Plans section? |
Yes, (As far as i remember, you can't sell/trade the item, as it disappears from your inventory as soon as you equip it. -->) this is true but if you equip it and immediately trade it you get the vip and also trade it to another person maybe better to block the trade for this item entirely |
Ahh I see, just add "trade" "0" to the config, but I'll check what you wrote |
If it's possible to trade an item after using it, then it is a pretty serious exploit indeed. Thanks for notifying us. However, I think you're talking about an equipable item. The VIP is another type of item: "the 1 use item". You can't equip them, but you can use them. After using it, the item will be removed from your inventory. |
store plugin already haves "ignore_vip" option, but works only with flags, can this be implemented with this vip core plugin? |
also,after vip expires, in database vip players must be removed, to cleanup table. |
#include
#include
#include <vip_core>
#define PLUGIN_AUTHOR "Pr[E]fix | vk.com/cyxaruk1337"
#define PLUGIN_NAME "[Shop] Buy ViP"
#define PLUGIN_VERSION "2.0"
#define PLUGIN_DESCRIPTION "Возможность добавить покупку vip за кредиты в shop"
KeyValues kv;
public Plugin:myinfo =
{
name = PLUGIN_NAME,
author = PLUGIN_AUTHOR,
description = PLUGIN_DESCRIPTION,
version = PLUGIN_VERSION,
url = "hlmod.ru/members/pr-e-fix.110719"
};
public void OnPluginStart()
{
if (Shop_IsStarted())
Shop_Started();
}
public void OnPluginEnd()
{
Shop_UnregisterMe();
}
public void Shop_Started()
{
CategoryId category = Shop_RegisterCategory("vip", "Покупка VIP", "");
}
public bool CallBack_Shop_OnBuy(int client, CategoryId category_id, const char[] category, ItemId item_id, const char[] item, ItemType type, int price, int sell_price, int value)
{
if (VIP_IsClientVIP(client))
{
PrintToChat(client, "У вас уже имеется VIP Статус");
return false;
}
else
{
char buff[64];
kv.Rewind();
if(kv.JumpToKey(item))
{
kv.GetString("vip_group", buff, sizeof(buff));
VIP_GiveClientVIP(_, client, kv.GetNum("duration"), buff);
}
}
}
The text was updated successfully, but these errors were encountered: