Functions

Client-side functions

iCore.player.getData

Return player data for using in client-side.

local player = iCore.player.getData()
print(json.encode(player))

iCore.player.freezee

Freezee player at current coords.

local playerId = PlayerId()
-- freeze
local player = iCore.player.freeze(playerId, true)
-- un freeze
local player = iCore.player.freeze(playerId, false)

iCore.player.spawn

Spawn player at coords and set some data.

-- spawn data
local data = {}
-- required
data['x'] = 0.0; data['y'] = 0.0; data['z'] = 0.0; data['heading'] = 0.0;
-- spawn
iCore.player.spawn(data)

iCore.player.openCharacterCreator

Open character creator, we can use it for clothe shop or in some case, not only signup process. In signup process, iCore do it, you don't need to care.

-- init character creator data
local data = {}
-- camera position: default, head, body, bottom
data['position'] = 'default'
-- list options allow to change
data['allows'] = {'close','models','inheritance','hair','beard','eyeBrown','lipsEye','nose','cheeks','jaw','chimp','neck','blemishes','ageing','blush','makeup','torsos','undershirts','tops','legs','shoes','accessory','masks','hat','glass','ear','watch','bracelet'}
iCore.player.openCharacterCreator(data)

iCore.player.setCharacterData

Set player character data like model, skin, clothes....

-- init character data
local data = {}
data['model'] = 'mp_m_freemode_01'
iCore.player.setCharacterData(data)

We can set many character data as character creator do it. But remember the data is group by. You can't send data in group alone. Must full data of group. List of groups is below.

  • shapeFirstID, shapeSecondID, skinFirstID, skinSecondID, shapeMix, skinMix

-- init character data
local data = {}
data['model'] = 'mp_m_freemode_01'
data['shapeFirstID'] = 1
data['shapeSecondID'] = 1
data['skinFirstID'] = 1
data['skinSecondID'] = 1
data['shapeMix'] = 1.0
data['skinMix'] = 0.5
iCore.player.setCharacterData(data)
  • hairStyle, hairColor1, hairColor2

  • beardStyle, beardOpacity, beardColor

  • eyeBrownStyle, eyeBrownOpacity, eyeBrownColor

  • eyeOpening, lipThickness, eyeColor, lipstickStyle, lipstickOpacity, lipstickColor

  • noseWidth, nosePeakHight, nosePeakLenght, noseBoneHigh, nosePeakLowering, noseBoneTwist

  • cheeksBoneHigh, cheeksBoneWidth, cheeksWidth

  • chimpBoneLowering, chimpBoneLenght, chimpBoneWidth, chimpHole

  • neckThickness

  • blemishesStyle, blemishesOpacity

  • complexionStyle, complexionOpacity

  • ageingStyle, ageingOpacity

  • blushStyle, blushOpacity, blushColor

  • makeupStyle, makeupOpacity

  • torsosStyle, torsosTexture

  • undershirtsStyle, undershirtsTexture

  • topsStyle, topsTexture

  • legsStyle, legsTexture

  • shoesStyle, shoesTexture

  • accessoryStyle, accessoryTexture

  • masksStyle, masksTexture

  • hatStyle, hatTexture

  • glassStyle, glassTexture

  • earStyle, earTexture

  • watchStyle, watchTexture

  • braceletStyle, braceletTexture

iCore.blip.create

Create blip for current player.

local data = {name = 'Boxing', color = 1, sprite = 536, scale = 0.6, coords = vector3(185.66, -1272.98, 29.19), flash = true, remove = 6000}
iCore.blip.create(data)

iCore.shared.functions.closestPlayer

Create closest player near current player and return playerServerId.

local range = 2.0
local closestPlayer = iCore.shared.functions.closestPlayer(range)
-- result is in playerServerId
print(closestPlayer)

iCore.shared.functions.enumerateObjects

Find nearly objects.

iCore.shared.functions.enumeratePeds

Find nearly peds.

iCore.shared.functions.enumerateVehicles

Find nearly vehicles.

iCore.shared.functions.enumeratePickups

Find nearly pickups

iCore.shared.functions.loadModel

Load model for ped, entity, object creating.

-- input is model name string, not hash
iCore.shared.functions.loadModel('mp_m_freemode_01')

iCore.shared.functions.deleteEntity

Delete entity by entityId.

iCore.shared.functions.deleteEntity(1235)

iCore.shared.functions.pedSilent

Set ped silent, can not be damaged or ragdoll by everyone. Using it for create default ped in shop, is dealer or something like this.

iCore.shared.functions.pedSilent(1235)

iCore.shared.functions.playAnim

Set ped play animations, can be current ped or others.

iCore.shared.functions.playAnim({ped = PlayerPedId(), dict = 'anim_casino_b@amb@casino@games@shared@player@', anim = 'sit_enter_left_side', flag = 49, duration = 3000, speed = 1.0, speedMultiplier = 1.0, playbackRate = 1.0})

In case we don't set the dict this function will know anim as scenario and play it.

iCore.shared.functions.playAnim({anim = 'WORLD_HUMAN_BINOCULARS'})

iCore.ui.send

Send data to iCore NUI. Many features in this function but most is the NUI javascript handle it. For example, we can send notify.

local data = {}
data['ui] = 'notify'
data['type'] = 'info' -- success, danger, warning, info, dark, secondary
data['sender'] = 'no one or everyone' -- don't set will be System for default
data['message'] = 'can use <strong>html</strong>'
data['duration'] = 10000 -- default is 5000
iCore.ui.send(data)

Or we can show the countdown.

iCore.ui.send({ui = 'countdown', message = 'Bet for play or fold', duration = 15000})

iCore.ui.copy

Copy string data from game to clipboard. Very helpful when develop or get the coords.

local coords = GetEntityCoords(PlayrePedId())
iCore.ui.copy(coords.x .. ' ' .. coords.y .. ' ' .. coords.z)

iCore.vehicle.spawn

Spawn vehicle with input data.

local data = {}
data['vehicleId'] = 123 -- unique vehicle id, like same with vehicle id in database
data['metadata'] = {x = 0.0, y = 0.0, z = 0.0, heading = 100.0}
data['customs'] = {model = 'sultan', plate = 'LS999999'} -- and many customs can be unput, the customs auto fire to iCore.vehicle.customs()

iCore.vehicle.customs

Customs vehicle appearance.

iCore.vehicle.customs(entityId, {model = 'sultan', plate = 'LS999999'})

Many customs data listed below.

  • maxSpeed

  • health

  • engine

  • petrol

  • plate

  • plateIndex

  • dirtLevel

  • colorPrimary, colorSecondary

  • colorPearlescent, colorWheel

  • colorInterior

  • colorDashboard

  • windowTint

  • neonEnabled

  • extras

  • neonColor

  • modSmokeEnabled

  • tyreSmokeColor

  • modSpoilers

  • modFrontBumper

  • modRearBumper

  • modSideSkirt

  • modExhaust

  • modFrame

  • modGrille

  • modHood

  • modFender

  • modRightFender

  • modRoof

  • modEngine

  • modBrakes

  • modTransmission

  • modHorns

  • modSuspension

  • modArmor

  • modNitrous

  • modTurbo

  • modSubwoofer

  • modHydraulics

  • modXenon

  • xenonColor

  • modFrontWheels

  • modBackWheels

  • modPlateHolder

  • modVanityPlate

  • modTrimA

  • modOrnaments

  • modDashboard

  • modDial

  • modDoorSpeaker

  • modSeats

  • modSteeringWheel

  • modShifterLeavers

  • modAPlate

  • modSpeakers

  • modTrunk

  • modHydrolic

  • modEngineBlock

  • modAirFilter

  • modStruts

  • modArchCover

  • modAerials

  • modTrimB

  • modTank

  • modWindows

  • modDoorR

  • modLivery

  • modLightbar

iCore.vehicle.isFront

Check player is front of vehicle.

iCore.vehicle.isFront(entityId)

Last updated