跳转至

game


get_global_int

int game.get_global_int(int global)

Returns the current value of the provided global
Example Usage
local value = game.get_global_int(--[[global]])

set_global_int

void game.set_global_int(int global, int value)

Sets the current value of the provided global
Example Usage
game.set_global_int(--[[global]], --[[value]])

get_global_float

float game.get_global_float(int global)

Returns the current value of the provided global
Example Usage
local value = game.get_global_float(--[[global]])

set_global_float

void game.set_global_float(int global, float value)

Sets the current value of the provided global
Example Usage
game.set_global_float(--[[global]], --[[value]])

get_local_int

int game.get_local_int(int script_hash, int local)

Returns the current value of the provided local
Example Usage
local value = game.get_local_int(--[[script_hash]], --[[local]])

set_local_int

void game.set_local_int(int script_hash, int local, int value)

Sets the current value of the provided local
Example Usage
game.set_local_int(--[[script_hash]], --[[local]], --[[value]])

get_local_float

float game.get_local_float(int script_hash, int local)

Returns the current value of the provided local
Example Usage
local value = game.get_local_float(--[[script_hash]], --[[local]])

set_local_float

void game.set_local_float(int script_hash, int local, float value)

Sets the current value of the provided local
Example Usage
game.set_local_float(--[[script_hash]], --[[local]], --[[value]])

get_world_peds

int[] game.get_world_peds()

Returns an array of world peds as script guids
Example Usage
for i, ped in ipairs(game.get_world_peds()) do
    -- do something with ped
end

get_world_vehicles

int[] game.get_world_vehicles()

Returns an array of world vehicles as script guids
Example Usage
for i, vehicle in ipairs(game.get_world_vehicles()) do
    -- do something with vehicle
end

get_world_objects

int[] game.get_world_objects()

Returns an array of world objects as script guids
Example Usage
for i, object in ipairs(game.get_world_objects()) do
    -- do something with object
end

get_world_blips

int[] game.get_world_blips()

Returns an array of world blips
Example Usage
for i, blip in ipairs(game.get_world_blips()) do
    -- do something with blip
end

get_entity_owner

int game.get_entity_owner(int script_guid)

Returns the player index that owns the provided entity
Example Usage
local owner = game.get_entity_owner(--[[script_guid]])

get_gameplay_camera_coords

vec3 game.get_gameplay_camera_coords()

Returns gameplay camera coordinates
Example Usage
local coords = game.get_gameplay_camera_coords()

get_gameplay_camera_up

vec3 game.get_gameplay_camera_up()

Returns gameplay camera up vector
Example Usage
local up_vector = game.get_gameplay_camera_up()

get_gameplay_camera_right

vec3 game.get_gameplay_camera_right()

Returns gameplay camera right vector
Example Usage
local right_vector = game.get_gameplay_camera_right()

get_gameplay_camera_forward

vec3 game.get_gameplay_camera_forward()

Returns gameplay camera right vector
Example Usage
local forward_vector = game.get_gameplay_camera_forward()

world_to_screen

bool, float, float game.world_to_screen(vec3 world_coords)

Returns screen position provided world coordinates
Example Usage
local on_screen, x, y = game.world_to_screen(--[[world_coords]])