Jump to content

getElementData problem


..:D&G:..

Recommended Posts

Posted

Hello guys, I keep getting an error when I want to get an element data of the player that clicks a button

function checkShipment(button, state, thePlayer) 
local level = getElementData(thePlayer, "level") 
    if (source==bCheck) and (button=="left") then 
  
.................................. 

I keep getting the error which says that the script gets the string "left", as the script gets the element data of the button and not the player. Any ideas how to fix it?

76561198066470453.png

SP37Ecj.jpg?2MTA:Rust Pre-Alpha Build v.0.3:SP37Ecj.jpg?2

https://forum.mtasa.com/viewtopic.php?f=114&t=97848

2Pac: ''Only God can judge me!''

Posted
function checkShipment(button, state, thePlayer) 
local level = getElementData(thePlayer, "level") 
    if (thePlayer == bCheck ) and (thePlayer == left) then 

I'll help When I Can.

Posted
function checkShipment(button, state, thePlayer) 
local level = getElementData(thePlayer, "level") 
   if (source==bCheck) then 
    if (button ~= "left" or state ~= "down") then return end 
  
-- < your code here >  
  
end  
end 

Failure is simply an opportunity to begin again more intelligently - Henry Ford

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