Jump to content

Recommended Posts

Hi guys.

 

I have a problem with my server and is that....

 

All my tickets doesn't work and i want know why doesn't work, if anyone of you guys know something please help me :c

PD: only old ticket work....

 

 

Tanks to all :3

Share this post


Link to post
Share on other sites

can you offer more information about the bug? which file be using?


Being better than others is for those who are weak; what matters is to be true to yourself.         

 

Share this post


Link to post
Share on other sites
TicketsUse = {Enabled = true, Ticket = {}, BlackList = {}}
TicketsUse.BlackList["garner2"] = {Name = "Chaos Argent", Active = true}
TicketsUse.BlackList["prisonisland"] = {Name = "Prison Island", Active = true}
TicketsUse.Ticket[3141] = {Name = "", Level = {Min = nil, Max = nil}} --old ticket 
TicketsUse.Ticket[4602] = {Name = "Argent City", Level = {Min = nil, Max = nil}}
------- how to use 
---TicketsUse.Ticket[ItemID] = {Name = "Birth", Level = {Min = 15, Max = 50}}
--------
--function of iteminfo
function TicketHandler(Player, Item)
	local ItemID = GetItemID(Item)
	
	if TicketsUse.Ticket[ItemID] == nil then
		SystemNotice(Player, "["..GetItemName(ItemID).."] is not usable, please contact administrator.")
		UseItemFailed(Player)
		return 
	end
	if TicketsUse.Ticket[ItemID].Level.Min ~= nil and GetChaAttr(Player, ATTR_LV) < TicketsUse.Ticket[ItemID].Level.Min then
		SystemNotice(Player, "["..GetItemName(ItemID).."] is only usable for players above level "..TicketsUse.Ticket[ItemID].Level.Min..".")
		UseItemFailed(Player)
		return 
	end
	if TicketsUse.Ticket[ItemID].Level.Max ~= nil and GetChaAttr(Player, ATTR_LV) > TicketsUse.Ticket[ItemID].Level.Max then
		SystemNotice(Player, "["..GetItemName(ItemID).."] is only usable for players below level "..TicketsUse.Ticket[ItemID].Level.Max..".")
		UseItemFailed(Player)
		return 
	end	
	if(Hp(Player) <(Mxhp(Player) * 0.5)) or(Sp(Player) <(Mxsp(Player) * 0.5)) or ChaIsBoat(Player) == 1 then
		SystemNotice(Player, "You must not be in a boat and have at least half of your maximum HP and SP in order to teleport.")
		UseItemFailed(Player)
		return 
	end
	if TicketsUse.BlackList[GetChaMapName(Player)] ~= nil and TicketsUse.BlackList[GetChaMapName(Player)].Active == true then
		SystemNotice(Player, "Cannot use tickets inside ["..TicketsUse.BlackList[GetChaMapName(Player)].Name.."].")
		UseItemFailed(Player)
		return 
	end	
	if DelBagItem(Player, ItemID, 1) == 1 then
		MoveCity(Player, TicketsUse.Ticket[ItemID].Name)
	else
		SystemNotice(Player, "Failed to use ["..GetItemName(ItemID).."].")
		UseItemFailed(Player)
		return 
	end	
	LG("Ticket System", "Player["..GetChaDefaultName(Player).."] used ["..GetItemName(ItemID).."].")	
end

use this for your tickets 

Share this post


Link to post
Share on other sites

Hello @layiperd24!

 

Any errors? What happens when you use a ticket?


Share this post


Link to post
Share on other sites
On 10/30/2021 at 2:18 PM, Mesut said:

yea i have same issue can somebody show where to add above script on serverfile pls!!

I think you need add the script to file functions.lua and change the functions that are called when using an ticket item in ItemInfo.txt to TicketHandler.

 

For example, change:

4602	Ticket to Argent	n0307	10130005	0	0	0	0	0	00	36	0	0	0	0	0	1	1	1	1	99	0	500	-1	0	-1	0	0	-1	-1	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0	0	0,0	0	0	0	0	0	0	0	0	0	Jz_Script_bycs	0	0	0	0	0	0	Teleport ticket to Argent City	
4603	Ticket to Shaitan	n0307	10130005	0	0	0	0	0	00	36	0	0	0	0	0	1	1	1	1	99	0	500	-1	0	-1	0	0	-1	-1	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0	0	0,0	0	0	0	0	0	0	0	0	0	Jz_Script_slcs	0	0	0	0	0	0	Teleport ticket to Shaitan City	
4604	Ticket to Icicle	n0307	10130005	0	0	0	0	0	00	36	0	0	0	0	0	1	1	1	1	99	0	500	-1	0	-1	0	0	-1	-1	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0	0	0,0	0	0	0	0	0	0	0	0	0	Jz_Script_blbcs	0	0	0	0	0	0	Teleport ticket to Icicle City	

to

4602	Ticket to Argent	n0307	10130005	0	0	0	0	0	00	36	0	0	0	0	0	1	1	1	1	99	0	500	-1	0	-1	0	0	-1	-1	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0	0	0,0	0	0	0	0	0	0	0	0	0	TicketHandler	0	0	0	0	0	0	Teleport ticket to Argent City	
4603	Ticket to Shaitan	n0307	10130005	0	0	0	0	0	00	36	0	0	0	0	0	1	1	1	1	99	0	500	-1	0	-1	0	0	-1	-1	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0	0	0,0	0	0	0	0	0	0	0	0	0	TicketHandler	0	0	0	0	0	0	Teleport ticket to Shaitan City	
4604	Ticket to Icicle	n0307	10130005	0	0	0	0	0	00	36	0	0	0	0	0	1	1	1	1	99	0	500	-1	0	-1	0	0	-1	-1	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0	0	0,0	0	0	0	0	0	0	0	0	0	TicketHandler	0	0	0	0	0	0	Teleport ticket to Icicle City	

 

Also you need fill TicketsUse.Ticket table as shown in the example at the beginning of the script.


Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...