Functions
Server-side functions
iCore.player.getPlayerByLicense
local player = iCore.player.getPlayerByLicense(license)
print('json.encode(player))
iCore.player.getData
local id = source
local player = iCore.player.getData(id)
print(json.encode(player))
iCore.player.setData
local id = source
iCore.player.setData(id, {fakeName = 'Julia'})
iCore.player.save
AddEventHandler('playerDropped', function(reason)
local id = source
local player = iCore.player.getData(id)
if player and player.userId then
iCore.player.save(player)
print('Player disconnect (User ID: ' .. player.userId .. ') (Name: ' .. player.name .. ') (Reason: ' .. reason .. ')')
end
end)
iCore.player.item
local id = source
iCore.player.item(id, {item = 'cash', amount = 30})
local id = source
iCore.player.item(id, {item = 'cash', amount = -30})
Last updated