Raised This Month: $51 Target: $400
 12% 

[REQ] Add flag to Zephyrus Store


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ssandiss
Junior Member
Join Date: Jan 2018
Location: Sweden
Old 01-26-2018 , 05:04   [REQ] Add flag to Zephyrus Store
Reply With Quote #1

Hey,

I got an idea which I am not sure how to fulfill.

It's a plugin for Zephyrus plugin "Store".
The function of the idea is to add into the store the option to buy an admin flag for the in-game credits you recieve from his main plugin.

I have looked a bit through the API and see that there is a setFlag function, just not sure how to use it correctly with Zephyrus credits etc.

Would appreiciate some help.

Kind regards
ssandiss is offline
thoxik
Member
Join Date: Oct 2017
Old 01-31-2018 , 17:07   Re: [REQ] Add flag to Zephyrus Store
Reply With Quote #2

That would be nice!

Last edited by thoxik; 01-31-2018 at 17:07.
thoxik is offline
ssandiss
Junior Member
Join Date: Jan 2018
Location: Sweden
Old 02-19-2018 , 06:56   Re: [REQ] Add flag to Zephyrus Store
Reply With Quote #3

Still looking for this kind of plugin
ssandiss is offline
Totenfluch
AlliedModders Donor
Join Date: Jan 2012
Location: Germany
Old 02-19-2018 , 21:18   Re: [REQ] Add flag to Zephyrus Store
Reply With Quote #4

PHP Code:
public void OnPluginStart() {
    
HookEvent("player_spawn"onPlayerSpawn);
    
Store_RegisterHandler("vipbonus"""vip_OnMapStartvip_Resetvip_Configvip_Equipvip_Removetrue);
}

public 
vip_OnMapStart() {  }

public 
vip_Reset() {  }

public 
vip_Config(&Handle:kvitemid) {
    
Store_SetDataIndex(itemid0);
    return 
true;
}

public 
vip_Equip(clientid) {
    return -
1;
}

public 
vip_Remove(clientid) {  }

public 
Action onPlayerSpawn(Handle event, const char[] namebool dontBroadcast) {
    
int client GetClientOfUserId(GetEventInt(event"userid"));
    
int m_iEquipped Store_GetEquippedItem(client"vipbonus");
    if (
m_iEquipped 0) {
        return 
Plugin_Continue;
    }
    
setVip(client);
    return 
Plugin_Continue;
}

public 
void setVip(int client) {
    
SetUserFlagBits(clientGetUserFlagBits(client) | ADMFLAG_CUSTOM1);

__________________
Notable Projects:
Event Item Spawner | Scissors, Rock, Paper for ZephStore
tVip | Smart Link Remover
PLG & GGC - CS:GO Roleplay

and countless more...

I can make a helicopter shoot missles if you want me to...
Totenfluch is offline
ssandiss
Junior Member
Join Date: Jan 2018
Location: Sweden
Old 02-20-2018 , 06:11   Re: [REQ] Add flag to Zephyrus Store
Reply With Quote #5

Not sure where I would implement the code. Also. Would that code add a new "type" called vipbonus which I could use to add to the shop in the config?
ssandiss is offline
Totenfluch
AlliedModders Donor
Join Date: Jan 2012
Location: Germany
Old 02-20-2018 , 11:23   Re: [REQ] Add flag to Zephyrus Store
Reply With Quote #6

compile it, load it and but the type "vipbonus" into the items.txt. Also add translations for it
__________________
Notable Projects:
Event Item Spawner | Scissors, Rock, Paper for ZephStore
tVip | Smart Link Remover
PLG & GGC - CS:GO Roleplay

and countless more...

I can make a helicopter shoot missles if you want me to...
Totenfluch is offline
ssandiss
Junior Member
Join Date: Jan 2018
Location: Sweden
Old 02-21-2018 , 12:13   Re: [REQ] Add flag to Zephyrus Store
Reply With Quote #7

Hi again. This might be a stupid question but I've never worked out translations.

How would the file look for this specific plugin? I've compiled it and added it to my server so far.

[Edit]
Found out what I was suppose to do. Everything worked as intended. Thanks for the help!

Last edited by ssandiss; 02-21-2018 at 12:40.
ssandiss is offline
hunter95
New Member
Join Date: Mar 2020
Old 03-31-2020 , 02:12   Re: [REQ] Add flag to Zephyrus Store
Reply With Quote #8

Hi Guys! I want to add that feature to my store, too.

Quote:
public void OnPluginStart() {
HookEvent("player_spawn", onPlayerSpawn);
Store_RegisterHandler("vipbonus", "", vip_OnMapStart, vip_Reset, vip_Config, vip_Equip, vip_Remove, true);
}

public vip_OnMapStart() { }

public vip_Reset() { }

public vip_Config(&Handle:kv, itemid) {
Store_SetDataIndex(itemid, 0);
return true;
}

public vip_Equip(client, id) {
return -1;
}

public vip_Remove(client, id) { }

public Action onPlayerSpawn(Handle event, const char[] name, bool dontBroadcast) {
int client = GetClientOfUserId(GetEventInt(event, "userid"));
int m_iEquipped = Store_GetEquippedItem(client, "vipbonus");
if (m_iEquipped < 0) {
return Plugin_Continue;
}
setVip(client);
return Plugin_Continue;
}

public void setVip(int client) {
SetUserFlagBits(client, GetUserFlagBits(client) | ADMFLAG_CUSTOM1);
}
i can't compile it or im doing something wrong. i created an file called vipbonus.sp with that code and put it into sourcemod/scripting/store/.
I added on the Store.sp: #include "store/vipbonus.sp"
i tried to compile the store.sp but it closes right after opening. Any idea what im doing wrong?
hunter95 is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 10:22.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode