Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- hypothetical behavior of getPlayerIp
- function getPlayerIp(cid)
- return cid
- end
- killRewardToken = {} --
- ---------------------------------
- -- this would go in a global or compat
- -- constructor, you would want to call this up 1st
- function killRewardToken.new()
- local temp = {} -- empty table,
- -- construct our metatable
- setmetatable(temp, killRewardToken)
- end
- -- this is to set the ip as the index of the metatable killRewardToken, with an initial value of current time
- function killRewardToken:SetTable(cid)
- self[getPlayerIp(cid)] = os.time()
- end
- -- this just current time stored in killRewardToken
- function killRewardToken:get(cid)
- return self[getPlayerIp(cid)]
- end
- -----------------------------
- killRewardToken.new()
- killRewardToken:SetTable(123)
- print(killRewardToken:get(123))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement