Plugin Available buy xp

Unpaid Requests, Public Plugins
Post Reply
czirimbolo
Veteran Member
Veteran Member
Poland
Posts: 507
Joined: 2 Years Ago
Has thanked: 19 times
Been thanked: 1 time
Contact:

buy xp

#1

Post by czirimbolo » 10 Months 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
Jack GamePlay
Mod Developer
Mod Developer
Egypt
Posts: 577
Joined: 2 Years Ago
Location: Egypt
Has thanked: 34 times
Been thanked: 47 times
Age: 19
Contact:

#2

Post by Jack GamePlay » 10 Months 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)
	}
}
These users thanked the author Jack GamePlay for the post:
czirimbolo (10 Months Ago)
Not interested in CS/Pawn anymore.
Accepting web projects.

czirimbolo
Veteran Member
Veteran Member
Poland
Posts: 507
Joined: 2 Years Ago
Has thanked: 19 times
Been thanked: 1 time
Contact:

#3

Post by czirimbolo » 10 Months 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
Senior Member
Senior Member
United States of America
Posts: 281
Joined: 11 Months Ago
Location: Des Moines/USA
Has thanked: 6 times
Been thanked: 21 times
Age: 33
Contact:

#4

Post by Mark » 10 Months Ago

czirimbolo wrote:
10 Months 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
Jack GamePlay
Mod Developer
Mod Developer
Egypt
Posts: 577
Joined: 2 Years Ago
Location: Egypt
Has thanked: 34 times
Been thanked: 47 times
Age: 19
Contact:

#5

Post by Jack GamePlay » 10 Months Ago

czirimbolo wrote:
10 Months 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.

[ Post made via Android ]
Not interested in CS/Pawn anymore.
Accepting web projects.

czirimbolo
Veteran Member
Veteran Member
Poland
Posts: 507
Joined: 2 Years Ago
Has thanked: 19 times
Been thanked: 1 time
Contact:

#6

Post by czirimbolo » 10 Months Ago

Works well. Thanks
Image

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest