General Functions - THE-FYP/MoonAdditions GitHub Wiki

Functions

set_vehicle_model_alpha

set_vehicle_model_alpha(Vehicle handle, uint alpha)

set_char_model_alpha

set_char_model_alpha(Ped handle, uint alpha)

set_object_model_alpha

set_object_model_alpha(Object handle, uint alpha)

get_entity_type_and_class

uint type, uint class = get_entity_type_and_class(uint entity_ptr)

Returns nil on failure.

get_vehicle_number_of_collided_entites

int number = get_vehicle_number_of_collided_entites(Vehicle handle)

get_char_number_of_collided_entites

int number = get_char_number_of_collided_entites(Ped handle)

get_object_number_of_collided_entites

int number = get_object_number_of_collided_entites(Object handle)

get_vehicle_collided_entites

table<uint> entities = get_vehicle_collided_entites(Vehicle handle)

get_char_collided_entites

table<uint> entities = get_char_collided_entites(Ped handle)

get_object_collided_entites

table<uint> entities = get_object_collided_entites(Object handle)

set_car_window_state

set_car_window_state(Vehicle handle, uint window_id, bool state)

get_char_max_health

float health = get_char_max_health(Ped handle)

get_circles_intersection

bool result, float x1, float y1, float x2, float y2 = get_circles_intersection(float x1, float y1, float radius1, float x2, float y2, float radius2)

get_model_txd_id

int txd = get_model_txd_id(Model model)

get_model_crc32_key

uint crc32 = get_model_crc32_key(Model model)

Returns nil on failure.

draw_temporary_shadow

draw_temporary_shadow(uint shadow_type, float x, float y, float z, float width, float height, float rotation, float distance, uint/Texture texture, uint intensity, [int color_r, int color_g, int color_b, int color_a, uint shadow_data, float scale, bool draw_on_buildings, bool draw_on_water])

draw_permanent_shadow

draw_permanent_shadow(uint shadow_type, float x, float y, float z, float width, float height, float rotation, float distance, uint/Texture texture, uint intensity, uint time, [int color_r, int color_g, int color_b, int color_a])

draw_light

draw_light(uint light_type, float x, float y, float z, float dir_x, float dir_y, float dir_z, float radius, [int color_r, int color_g, int color_b, int color_a, uint entity])

draw_corona

draw_corona(uint/Texture texture, float x, float y, float z, float size, [int color_r, int color_g, int color_b, int color_a, uint entity])

draw_corona_ex

draw_corona_ex(uint/Texture texture, float x, float y, float z, float size, [int color_r, int color_g, int color_b, int color_a, uint entity, float far_clip, float near_clip, int flare, bool reflection, bool check_obstacles, int flash_while_fading, float fade_speed, bool only_from_below])

get_sun_colors

int core_r, int core_g, int core_b, int corona_r, int corona_g, int corona_b = get_sun_colors()

get_sun_size

float core, float corona = get_sun_size()

get_sun_screen_coordinates

float x, y = get_sun_screen_coordinates()

get_sun_world_position

bool visible, float x, float y, float z = get_sun_world_position()

get_current_weather

int weather = get_current_weather()

get_traffic_lights_color

int color1, color2 = get_traffic_lights_color()

get_car_light_damage_status

uint status = get_car_light_damage_status(Vehicle handle, int light_id)

Returns nil on failure.

set_car_light_damage_status

set_car_light_damage_status(Vehicle handle, int light_id, uint status)

get_vehicle_class

uint class, uint subclass = get_vehicle_class(Vehicle handle)

Returns nil on failure.

get_vehicle_dummy_element_position

float x, float y, float z = get_vehicle_dummy_element_position(Vehicle handle, uint element, [bool world, bool invert_x])

create_projectile

bool result = create_projectile(uint weapon_id, float src_x, float src_y, float src_z, float dir_x, float dir_y, float dir_z, float force, uint source_entity_ptr, uint target_entity_ptr)

get_game_volume

int sfx_volume, int radio_volume = get_game_volume()

get_collision_between_points

table collision = get_collision_between_points(float origin_x, float origin_y, float origin_z, float target_x, float target_y, float target_z, [table<string=bool> flags, uint ignore_entity_ptr])

Returns nil on failure.

draw_spotlight

draw_spotlight(float origin_x, float origin_y, float origin_z, float target_x, float target_y, float target_z, float base_radius, float target_radius, bool shadow, float shadow_intensity)

draw_rect

draw_rect(float left, float top, float right, float bottom, int r, int g, int b, int a, [float angle])

draw_rect_with_gradient

draw_rect_with_gradient(float left, float top, float right, float bottom, int r1, int g1, int b1, int a1, int r2, int g2, int b2, int a2, int r3, int g3, int b3, int a3, int r4, int g4, int b4, int a4, [float angle])

get_all_objects

table<Object> objects = get_all_objects(float x, float y, float z, [float radius, bool sphere])

get_all_characters

table<Ped> chars = get_all_characters(float x, float y, float z, [float radius, bool skip_dead, bool sphere])

get_all_vehicles

table<Vehicle> vehicles = get_all_vehicles(float x, float y, float z, [float radius, bool skip_wrecked bool sphere])

get_object_matrix

Matrix matrix = get_object_matrix(Object handle)

Returns nil on failure.

get_char_matrix

Matrix matrix = get_char_matrix(Ped handle)

Returns nil on failure.

get_vehicle_matrix

Matrix matrix = get_vehicle_matrix(Vehicle handle)

Returns nil on failure.

draw_text

draw_text(string text, float x, float y, [uint style, float width, float height, uint align, float wrap, bool proportional, bool justify, int text_r, int text_g, int text_b, int text_a, uint outline, uint shadow, int shadow_r, int shadow_g, int shadow_b, int shadow_a, bool background, int background_r, int background_g, int background_b, int background_a])

Enums

car_light

  • FRONT_LEFT
  • FRONT_RIGHT
  • REAR_RIGHT
  • REAR_LEFT

collision_check_flag

  • VEHICLES
  • PEDS
  • BUILDINGS
  • OBJECTS
  • DUMMIES
  • SEE_THROUGH
  • SHOOT_THROUGH
  • IGNORE_SOME_OBJECTS

corona_texture

  • STAR
  • STAR_2
  • MOON
  • REFLECT
  • HEADLIGHT_LINE
  • RINGB

entity_class

  • ENTITY
  • BUILDING
  • TREADABLE
  • DUMMY_1
  • DUMMY_2
  • PHYSICAL
  • OBJECT
  • HAND
  • PROJECTILE
  • CUTSCENE_OBJECT
  • PED
  • CIVILIAN_PED
  • COP_PED
  • EMERGENCY_PED
  • PLAYER_PED
  • VEHICLE
  • AUTOMOBILE
  • HELI
  • MTRUCK
  • PLANE
  • QUAD
  • TRAILER
  • BIKE
  • BMX
  • BOAT
  • TRAIN

entity_type

  • NOTHING
  • BUILDING
  • VEHICLE
  • PED
  • OBJECT
  • DUMMY
  • NOTINPOOLS

light_type

  • DEFAULT
  • DIRECTIONAL
  • DARK
  • GLOBAL

shadow_texture

  • DEFAULT
  • CAR
  • PED
  • EXPLOSION
  • HELI
  • HEADLIGHT
  • BLOODPOOL
  • HEADLIGHT
  • BIKE
  • RCBARON
  • LAMP

shadow_type

  • DEFAULT
  • ADDITIVE
  • INVCOLOR
  • OIL_1
  • OIL_2
  • OIL_3
  • OIL_4
  • OIL_5

vehicle_class

  • AUTOMOBILE
  • MTRUCK
  • QUAD
  • HELI
  • PLANE
  • BOAT
  • TRAIN
  • FHELI
  • FPLANE
  • BIKE
  • BMX
  • TRAILER

vehicle_subclass

  • AUTOMOBILE
  • BIKE
  • HELI
  • BOAT
  • PLANE

vehicle_dummy

  • HEADLIGHTS
  • TAIL_LIGHTS
  • HEADLIGHTS_2
  • TAIL_LIGHTS_2
  • PED_FRONT_SEAT
  • PED_BACK_SEAT
  • EXHAUST
  • ENGINE
  • PETROLCAP
  • HOOKUP
  • PED_ARM

vehicle_window

  • FRONT_LEFT
  • FRONT_RIGHT
  • REAR_LEFT
  • REAR_RIGHT
⚠️ **GitHub.com Fallback** ⚠️