Jump to content

attemt to call local v (userdata value)


Dretax

Recommended Posts

Posted
local match = false
for k, v in ipairs(getElementsByType("pickup")) do
	if (getElementData(v, "ing.id") and tonumber(getElementData(v, "ing.id")) == id) then
		match = v
		break
	end
end

if match then
	setElementData(match "ing.own", specid)
end

Match is an element, has all the properties, and giving it a good value.

Somehow setlelementdata fails, why?

  • MTA Team
Posted (edited)

you're missing a comma

 

setElementData(match "ing.own", specid)

 

Edited by LopSided_
  • Thanks 1
  • Haha 1
Posted (edited)
25 minutes ago, LopSided_ said:

you're missing a comma

 


setElementData(match "ing.own", specid)

 

F*CK ME.

I was looking for it constantly and not even my F*CKing pycharm lua addon detected it -.--.-.--.-.-.-

Edited by Dretax
Posted
17 minutes ago, Dretax said:

I was looking for it constantly and not even my F*CKing pycharm lua addon detected it -.--.-.--.-.-.-

2

Try using Sublime Text 3 with Lua Linter addon. Works like a charm ;)

Posted
On 2017. 08. 19. at 00:07, Mr.Loki said:

Try using Sublime Text 3 with Lua Linter addon. Works like a charm ;)

Nah, I'm totally fine with Pycharm due to code analysis.

  • 7 months later...
  • Discord Moderators
Posted

It didnt, since its a valid form of calling a function.

 

print "test"

 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...