Jump to content

help setElementData and getElementData


MAB

Recommended Posts

Hi i am making a fisher job and i will use setElementData and getElementData but idk how to use these two functions.

what i want to use them for is the set the Data of the player as a fisher when he start the job then i will make some functions using getElementData ... checking if he is a fisher or not to make these functions... i just want to know how to use setElementData so can someone please tell me how the arguments works? and what are the arguments for?

*NOTE: if you speak Arabic then put me the reply in Arabic....if you aren't then no problem

Link to comment
Hi i am making a fisher job and i will use setElementData and getElementData but idk how to use these two functions.

what i want to use them for is the set the Data of the player as a fisher when he start the job then i will make some functions using getElementData ... checking if he is a fisher or not to make these functions... i just want to know how to use setElementData so can someone please tell me how the arguments works? and what are the arguments for?

*NOTE: if you speak Arabic then put me the reply in Arabic....if you aren't then no problem

all what you need is here wiki.

setElementData

getElementData

Link to comment
Hi i am making a fisher job and i will use setElementData and getElementData but idk how to use these two functions.

what i want to use them for is the set the Data of the player as a fisher when he start the job then i will make some functions using getElementData ... checking if he is a fisher or not to make these functions... i just want to know how to use setElementData so can someone please tell me how the arguments works? and what are the arguments for?

*NOTE: if you speak Arabic then put me the reply in Arabic....if you aren't then no problem

all what you need is here wiki.

setElementData

getElementData

walid....

if i understood what is written in the wiki why would i have come here?!

Link to comment
setElementData ( source, "fisherman", true) --Use it on function for accepting job 

This will set the player data as fisherman, source is the player so make sure to change it according to your function argument for player Element.

-- use it for checking 
if ( getElementData( source, "fisherman" ) == true ) then 

Same for source, define it accordingly...

Edited by Guest
Link to comment

small example i hope you get the idea

addCommandHandler ('data', 
function ()  
    setElementData ( localPlayer , "DataCheck",true ) 
end ) 
  
addCommandHandler('data2', 
function () 
    if getElementData ( localPlayer , "DataCheck") == true then 
        outputChatBox('Data Checked') 
        else 
        outputChatBox('Data not checked') 
    end 
end ) 

and check the wiki

Link to comment

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