Loading...

[Source] Prop utils

You decide how much to pay.

Description

About

Hello fellow CFX Community and mainly developers! :wave:

I want to present you simple yet usefull resources for developers and configurators.

This easy menu will allow you to spawn prop on ped bone and move + rotate it on all axis.
When you are done with positioning, simply press one button and you’ll get result right in clipboard - sipmly CTRL+V into your script and you have properly placed prop on ped.

  • Usefull for example esx_basic_needs custom models of foods and drinks.

  • Also this resource can be usefull to perfect your animations generated in AnimKit 5 by adding some props.

This resource is not obfuscated in any way means you can edit it as you want.

Features

  • Simple menu with easy controls (just arrows)
  • Variable change will re-attach prop so you can see how result will look like
  • Prop is despawned when script is stopped
  • Animations support
  • Standalone
  • Use command /proputil to invoke the menu
  • Copy result to clipboard and insert it right into your code
  • Ideal for setting props for scripts like ESX Basic Needs

Generated raw code looks like this:

local hash = GetHashKey("prop_cs_burger_01")
RequestModel(hash)
while not HasModelLoaded(hash) do
    Citizen.Wait(100)
    RequestModel(hash)
end
local prop = CreateObject(hash, GetEntityCoords(PlayerPedId()), true, true, true)
AttachEntityToEntity(prop, PlayerPedId(), GetPedBoneIndex(PlayerPedId(), 18905), 0.19, 0.0, 0.05, 0.0, -20.0, 0.0, true, true, true, false, 1, true)

5f38f3e4f90ba67240130fcc60c7250565888064.png

41d5835233461d7515c37cd114f4f95d6eded633.png

Changelog

v1.0.0

  • Initial release

v1.0.1

  • Fix of spawning prop properly by its name and player ped bone index
  • Variables around zero are now properly set

v1.0.2

  • Fix of model properly spawn

v1.0.3

  • Added check for ped bone and model not found

v1.0.4

  • Menu tweaks
  • Added support for playing animations

v1.0.5

  • Added check for animation dict
  • Added combo box for most relevant bones

v1.0.6

  • Added support for animation list (edit cl_main.lua:8)
  • Added few predefined animations (eating, drinking, usefull stuff)
  • Better error handling
  • Changed default anim flag to 49


d74c6fd02ef709d02ce7ce49391e3876ee39b580.png

Script by AnDy