Jump to content
xEvo7

Restrict a following Equipment to MAP

Recommended Posts

Hi Guys, just wondering. 

How can i restrict a fused equipment to a map? I know how to restrict an item but when its fused. They can enter with the item.. 


Hit Like If You Like It!

Tekken-7.jpg

Share this post


Link to post
Share on other sites

You're going to use the same method you say you have, but instead of checking for "GetItemID", you're going to check for "GetItemAttr(Item, ITEMATTR_VAL_FUSIONID)".

  • Like 3

Share this post


Link to post
Share on other sites
12 hours ago, Angelix said:

You're going to use the same method you say you have, but instead of checking for "GetItemID", you're going to check for "GetItemAttr(Item, ITEMATTR_VAL_FUSIONID)".

 

6 hours ago, Rinor said:

@xEvo7 take a look on glacierpk map ( roso files )

thank you both, gave me the idea. 


Hit Like If You Like It!

Tekken-7.jpg

Share this post


Link to post
Share on other sites

Hello @xEvo7!

 

functions.lua


function CheckItemIsForged(item)

	return (GetItemForgeParam(item, 0) > 0)
	
end


function NoForge(role)

	-- Checking Look
	for i = 0, enumEQUIP_RHAND + 1, 1 do
		local item = GetChaItem(role, 1, i)
		if (item ~= 0 and item ~= nil) then
			if (CheckItemIsForged(item) == 1) then
				return 0
			end
		end
	end
	
	-- Checking Inventory
	local kbsize = GetKbCap(role)
	for i = 0, kbsize - 1, 1 do
		local item = GetChaItem(role, 2, i)
		if (item ~= 0 and item ~= nil) then
			if (CheckItemIsForged(item) == 1) then
				return 0
			end
		end
	end
	
	return 1
	
end

entry.lua

function check_can_enter_mapname(role, copy_mgr)

	if (NoForge(role) == 0) then
		SystemNotice(role, "You have forged items! You can't enter the map!")
		return 0
	end
	
	return 1
	
end

Note: didn't tested

  • Like 1

Share this post


Link to post
Share on other sites

got eror when i use

	if (NoForge(role) == 0) then
		SystemNotice(role, "You have fused items! You can't enter the map!")
		return 0
	end
		return 1
	end

eror:

 

Untitled.png

Share this post


Link to post
Share on other sites
38 minutes ago, Fajar said:

@xEvo7 yes

Yes what? He asked for the function you put it into to, not a "yes or no" question. If you want help, you're going to need to be more specific.

Share this post


Link to post
Share on other sites
56 minutes ago, Angelix said:

Yes what? He asked for the function you put it into to, not a "yes or no" question. If you want help, you're going to need to be more specific.

Sorry im bad in english.

i put

function CheckItemIsForged(item)

	return (GetItemForgeParam(item, 0) > 0)
	
end


function NoForge(role)

	-- Checking Look
	for i = 0, enumEQUIP_RHAND + 1, 1 do
		local item = GetChaItem(role, 1, i)
		if (item ~= 0 and item ~= nil) then
			if (CheckItemIsForged(item) == 1) then
				return 0
			end
		end
	end
	
	-- Checking Inventory
	local kbsize = GetKbCap(role)
	for i = 0, kbsize - 1, 1 do
		local item = GetChaItem(role, 2, i)
		if (item ~= 0 and item ~= nil) then
			if (CheckItemIsForged(item) == 1) then
				return 0
			end
		end
	end
	
	return 1
	
end

at the end function.lua. And i put

function check_can_enter_glacierpk(role, copy_mgr)
	if (NoForge(role) == 0) then
		SystemNotice(role, "You have forged items! You can't enter the map!")
		return 0
		end
	return 1
end

in entry.lua

Share this post


Link to post
Share on other sites
7 hours ago, Fajar said:

 


function check_can_enter_glacierpk(role, copy_mgr)
	if (NoForge(role) == 0) then
		SystemNotice(role, "You have forged items! You can't enter the map!")
		return 0
		end
	return 1
end

in entry.lua


I think it should be like: 
 

function check_can_enter_glacierpk(role, copy_mgr)
	if (NoForge(role) == 0) then
		SystemNotice(role, "You have forged items! You can't enter the map!")
		return 0
	else
		return 1
	end
end

 

Share this post


Link to post
Share on other sites
7 hours ago, DangThao said:


I think it should be like: 
 


function check_can_enter_glacierpk(role, copy_mgr)
	if (NoForge(role) == 0) then
		SystemNotice(role, "You have forged items! You can't enter the map!")
		return 0
	else
		return 1
	end
end

 

I've tried it, and get the same error

Share this post


Link to post
Share on other sites

I think the problem is not the function itself, it may be that you deleted an end of another function.

Paste here the full entry.lua you've modified.

  • Like 1

Share this post


Link to post
Share on other sites
В 18.04.2017 в 20:02, DangThao сказал:


I think it should be like: 
 


function check_can_enter_glacierpk(role, copy_mgr)
	if (NoForge(role) == 0) then
		SystemNotice(role, "You have forged items! You can't enter the map!")
		return 0
	else
		return 1
	end
end

 

 

This is the same script. It does not matter whether 'return 1' is inside inside the if-else statement or not.


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...