Jump to content

[Question] data


The Killer

Recommended Posts

hello !

i have one question

why when i do this :

if getElementData(player, "HitMarker") == true then 
outputChatBox("You did take the money you can't take it twice", player, 255, 0, 0) 
else 
givePlayerMoney(player, 1) 
outputChatBox("You have got $1", player, 0, 255, 0) 
setElementData(player, "HitMarker", true) 

and i hit the marker again it say :

You did take the money you can't take it twice.

but when i do 'reconnect'

and hit it again, it give me the money !!

why is that ?

:x:x

Link to comment
  • Moderators

Cause ElementData is attached on an element. When this player/element leaves, the element is gone and so is the data.

Elements are actuality in lua expressed as user-data. Every element does have it's own user-data, they are build up out several numbers and letters.

When a player leaves the server his user-data can be saved at the server, but when he rejoins his user-data has been changed.

But you can use the player account (or serial) instead.

Edited by Guest
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...