Available buy xp

Unpaid Requests, Public Plugins
Post Reply
czirimbolo
Veteran Member
Veteran Member
Poland
Posts: 598
Joined: 7 years ago
Contact:

buy xp

#1

Post by czirimbolo » 5 years ago

Hey, can someone make a plugin with ability buying XP for coins?

For example:
pay 1000 coins - 700 exp
5000 coins - 4000 exp
10000 coins - 9000 exp
Image

User avatar
Night Fury
Mod Developer
Mod Developer
Posts: 677
Joined: 7 years ago
Contact:

#2

Post by Night Fury » 5 years ago

Code: Select all

#include <zombie_escape>
#include <ze_levels>

new g_iItems[3]

public plugin_init()
{
	register_plugin("[ZE] Extra: Buy XP", "1.0", "Jack GamePlay")
	g_iItems[0] = ze_register_item("1000 EC -> 700 XP", 1000, 0)
	g_iItems[1] = ze_register_item("5000 EC -> 4000 XP", 5000, 0)
	g_iItems[2] = ze_register_item("10000 EC -> 9000 XP", 10000, 0)
}

public ze_select_item_pre(id, itemid)
{
	if (itemid != g_iItems[0] || itemid != g_iItems[1] || itemid != g_iItems[2])
		return ZE_ITEM_AVAILABLE

	return ZE_ITEM_AVAILABLE
}

public ze_select_item_post(id, itemid)
{
	if (itemid == g_iItems[0])
	{
		ze_set_user_xp(id, ze_get_user_xp(id) + 700)
	}
	else if (itemid == g_iItems[1])
	{
		ze_set_user_xp(id, ze_get_user_xp(id) + 4000)
	}
	else if (itemid == g_iItems[2])
	{
		ze_set_user_xp(id, ze_get_user_xp(id) + 9000)
	}
}
Want your own mod edition? PM me.
Accepting private projects.
Discord: Fury#7469
Image

czirimbolo
Veteran Member
Veteran Member
Poland
Posts: 598
Joined: 7 years ago
Contact:

#3

Post by czirimbolo » 5 years ago

how to buy this in game? can you make a command like /getxp or something and after that I have menu with those 3 options?
Image

User avatar
Mark
VIP
VIP
United States of America
Posts: 283
Joined: 5 years ago
Location: Des Moines/USA
Contact:

#4

Post by Mark » 5 years ago

czirimbolo wrote: 5 years ago how to buy this in game? can you make a command like /getxp or something and after that I have menu with those 3 options?
Looks like they should be in your extra items list.

User avatar
Night Fury
Mod Developer
Mod Developer
Posts: 677
Joined: 7 years ago
Contact:

#5

Post by Night Fury » 5 years ago

czirimbolo wrote: 5 years ago how to buy this in game? can you make a command like /getxp or something and after that I have menu with those 3 options?
This will be in extra items menu.
Want your own mod edition? PM me.
Accepting private projects.
Discord: Fury#7469
Image

czirimbolo
Veteran Member
Veteran Member
Poland
Posts: 598
Joined: 7 years ago
Contact:

#6

Post by czirimbolo » 5 years ago

Works well. Thanks
Image

Post Reply

Create an account or sign in to join the discussion

You need to be a member in order to post a reply

Create an account

Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute

Register

Sign in

Who is online

Users browsing this forum: No registered users and 1 guest