├── LICENSE ├── README.md ├── client.lua └── fxmanifest.lua /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 mathu_lmn 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | **Description :spiral_notepad: :** 2 | 3 | :wave: Hello ! Today I'm releasing `mth-dev-commands`, a standalone resource that compiles some useful commands for developers ! 4 | 5 | **Usage :hammer_and_wrench: :** 6 | 7 | To use the resource, download it, put the `mth-dev-commands` folder in your main resources folder. 8 | Add `start mth-dev-commands` to your server.cfg and you're good to go ! 9 | 10 | **Features :sparkles: :** 11 | * STANDALONE : this means that you don't need any dependencies to start this script on your server 12 | * Easy to use 13 | * FREE 14 | * Open Source 15 | 16 | **Commands :keyboard: :** 17 | * /devcoords : Toggles the display of your coordinates and more 18 | * /devprops : Toggles the display of informations about the props around you 19 | * /devbones : Toggles the display of the bones names of your ped 20 | * /devtraffic : Toggles the display of the closest traffic nodes (Thanks to louyike for the inspiration / part of the snippet !) 21 | * /devground : Toggles the display of the ground material you're standing on 22 | 23 | 24 | Feel free to open an Issue or make a PR to help me improve this resource ! :smile: 25 | 26 | **Link to the resource :** [mathu-lmn/mth-dev-commands (github.com)](https://github.com/Mathu-lmn/mth-dev-commands) -------------------------------------------------------------------------------- /client.lua: -------------------------------------------------------------------------------- 1 | local coords = false 2 | 3 | RegisterCommand("devcoords", function() 4 | coords = not coords 5 | if coords then 6 | Citizen.CreateThread(function() 7 | while coords do 8 | Citizen.Wait(0) 9 | local entity = IsPedInAnyVehicle(PlayerPedId(), false) and GetVehiclePedIsIn(PlayerPedId(), false) or PlayerPedId() 10 | local x, y, z = table.unpack(GetEntityCoords(entity, true)) 11 | 12 | local roundx = tonumber(string.format("%.2f", x)) 13 | local roundy = tonumber(string.format("%.2f", y)) 14 | local roundz = tonumber(string.format("%.2f", z)) 15 | 16 | DrawTxt("~r~X:~s~ "..roundx, 0.32, 0.05) 17 | DrawTxt("~r~Y:~s~ "..roundy, 0.38, 0.05) 18 | DrawTxt("~r~Z:~s~ "..roundz, 0.445, 0.05) 19 | 20 | local heading = GetEntityHeading(entity) 21 | local roundh = tonumber(string.format("%.2f", heading)) 22 | DrawTxt("~r~H:~s~ "..roundh, 0.50, 0.05) 23 | 24 | local rx,ry,rz = table.unpack(GetEntityRotation(PlayerPedId(), 1)) 25 | DrawTxt("~r~RX:~s~ "..tonumber(string.format("%.2f", rx)), 0.38, 0.08) 26 | DrawTxt("~r~RY:~s~ "..tonumber(string.format("%.2f", ry)), 0.44, 0.08) 27 | DrawTxt("~r~RZ:~s~ "..tonumber(string.format("%.2f", rz)), 0.495, 0.08) 28 | 29 | local speed = GetEntitySpeed(PlayerPedId()) 30 | local rounds = tonumber(string.format("%.2f", speed)) 31 | DrawTxt("~r~Player Speed: ~s~"..rounds, 0.40, 0.92) 32 | 33 | local health = GetEntityHealth(PlayerPedId()) 34 | DrawTxt("~r~Player Health: ~s~"..health, 0.40, 0.95) 35 | 36 | local camRotX = GetGameplayCamRot(2).x 37 | DrawTxt("~r~CR X: ~s~"..tonumber(string.format("%.2f", camRotX)), 0.36, 0.88) 38 | 39 | local camRotY = GetGameplayCamRot(2).y 40 | DrawTxt("~r~CR Y: ~s~"..tonumber(string.format("%.2f", camRotY)), 0.44, 0.88) 41 | 42 | local camRotZ = GetGameplayCamRot(2).z 43 | DrawTxt("~r~CR Z: ~s~"..tonumber(string.format("%.2f", camRotZ)), 0.51, 0.88) 44 | 45 | local veheng = GetVehicleEngineHealth(GetVehiclePedIsUsing(PlayerPedId())) 46 | local vehbody = GetVehicleBodyHealth(GetVehiclePedIsUsing(PlayerPedId())) 47 | if IsPedInAnyVehicle(PlayerPedId(), false) then 48 | local vehenground = tonumber(string.format("%.2f", veheng)) 49 | local vehbodround = tonumber(string.format("%.2f", vehbody)) 50 | 51 | DrawTxt("~r~Engine Health: ~s~"..vehenground, 0.015, 0.76) 52 | 53 | DrawTxt("~r~Body Health: ~s~"..vehbodround, 0.015, 0.73) 54 | local state = Entity(GetVehiclePedIsUsing(PlayerPedId())).state 55 | DrawTxt("~r~Vehicle Fuel: ~s~"..tonumber(string.format("%.2f", GetVehicleFuelLevel(GetVehiclePedIsUsing(PlayerPedId())))) .. " - " .. state.fuel , 0.015, 0.70) 56 | end 57 | end 58 | end) 59 | end 60 | end, false) 61 | 62 | local showProps = false 63 | 64 | RegisterCommand("devprops", function() 65 | showProps = not showProps 66 | if showProps then 67 | Citizen.CreateThread(function() 68 | while showProps do 69 | Citizen.Wait(0) 70 | local pPed = PlayerPedId() 71 | for k, v in pairs(GetGamePool("CObject")) do 72 | if DoesEntityExist(v) then 73 | local coords = GetEntityCoords(v) 74 | local dst = #(GetEntityCoords(pPed) - coords) 75 | if dst <= 15.0 then 76 | if IsEntityOnScreen(v) then 77 | -- show a box around the prop, draw a text with the prop hash 78 | local x, y, z = table.unpack(GetEntityCoords(v)) 79 | local rx, ry, rz = table.unpack(GetEntityRotation(v, 2)) 80 | local hash = GetEntityModel(v) 81 | 82 | DrawText3D(x, y, z, "Hash: " .. hash .. "\nName : ".. GetEntityArchetypeName(v) .."\nCoords: " .. x .. ", " .. y .. ", " .. z .. "\nRotation: " .. rx .. ", " .. ry .. ", " .. rz) 83 | DrawBoxAroundEntity(v) 84 | end 85 | end 86 | end 87 | end 88 | end 89 | end) 90 | end 91 | end, false) 92 | 93 | local bones = { 94 | ["SKEL_ROOT"] = 0, 95 | ["FB_R_Brow_Out_000"] = 1356, 96 | ["SKEL_L_Toe0"] = 2108, 97 | ["MH_R_Elbow"] = 2992, 98 | ["SKEL_L_Finger01"] = 4089, 99 | ["SKEL_L_Finger02"] = 4090, 100 | ["SKEL_L_Finger31"] = 4137, 101 | ["SKEL_L_Finger32"] = 4138, 102 | ["SKEL_L_Finger41"] = 4153, 103 | ["SKEL_L_Finger42"] = 4154, 104 | ["SKEL_L_Finger11"] = 4169, 105 | ["SKEL_L_Finger12"] = 4170, 106 | ["SKEL_L_Finger21"] = 4185, 107 | ["SKEL_L_Finger22"] = 4186, 108 | ["RB_L_ArmRoll"] = 5232, 109 | ["IK_R_Hand"] = 6286, 110 | ["RB_R_ThighRoll"] = 6442, 111 | ["SKEL_R_Clavicle"] = 10706, 112 | ["FB_R_Lip_Corner_000"] = 11174, 113 | ["SKEL_Pelvis"] = 11816, 114 | ["IK_Head"] = 12844, 115 | ["SKEL_L_Foot"] = 14201, 116 | ["MH_R_Knee"] = 16335, 117 | ["FB_LowerLipRoot_000"] = 17188, 118 | ["FB_R_Lip_Top_000"] = 17719, 119 | ["SKEL_L_Hand"] = 18905, 120 | ["FB_R_CheekBone_000"] = 19336, 121 | ["FB_UpperLipRoot_000"] = 20178, 122 | ["FB_L_Lip_Top_000"] = 20279, 123 | ["FB_LowerLip_000"] = 20623, 124 | ["SKEL_R_Toe0"] = 20781, 125 | ["FB_L_CheekBone_000"] = 21550, 126 | ["MH_L_Elbow"] = 22711, 127 | ["SKEL_Spine0"] = 23553, 128 | ["RB_L_ThighRoll"] = 23639, 129 | ["PH_R_Foot"] = 24806, 130 | ["SKEL_Spine1"] = 24816, 131 | ["SKEL_Spine2"] = 24817, 132 | ["SKEL_Spine3"] = 24818, 133 | ["FB_L_Eye_000"] = 25260, 134 | ["SKEL_L_Finger00"] = 26610, 135 | ["SKEL_L_Finger10"] = 26611, 136 | ["SKEL_L_Finger20"] = 26612, 137 | ["SKEL_L_Finger30"] = 26613, 138 | ["SKEL_L_Finger40"] = 26614, 139 | ["FB_R_Eye_000"] = 27474, 140 | ["SKEL_R_Forearm"] = 28252, 141 | ["PH_R_Hand"] = 28422, 142 | ["FB_L_Lip_Corner_000"] = 29868, 143 | ["SKEL_Head"] = 31086, 144 | ["IK_R_Foot"] = 35502, 145 | ["RB_Neck_1"] = 35731, 146 | ["IK_L_Hand"] = 36029, 147 | ["SKEL_R_Calf"] = 36864, 148 | ["RB_R_ArmRoll"] = 37119, 149 | ["FB_Brow_Centre_000"] = 37193, 150 | ["SKEL_Neck_1"] = 39317, 151 | ["SKEL_R_UpperArm"] = 40269, 152 | ["FB_R_Lid_Upper_000"] = 43536, 153 | ["RB_R_ForeArmRoll"] = 43810, 154 | ["SKEL_L_UpperArm"] = 45509, 155 | ["FB_L_Lid_Upper_000"] = 45750, 156 | ["MH_L_Knee"] = 46078, 157 | ["FB_Jaw_000"] = 46240, 158 | ["FB_L_Lip_Bot_000"] = 47419, 159 | ["FB_Tongue_000"] = 47495, 160 | ["FB_R_Lip_Bot_000"] = 49979, 161 | ["SKEL_R_Thigh"] = 51826, 162 | ["SKEL_R_Foot"] = 52301, 163 | ["IK_Root"] = 56604, 164 | ["SKEL_R_Hand"] = 57005, 165 | ["SKEL_Spine_Root"] = 57597, 166 | ["PH_L_Foot"] = 57717, 167 | ["SKEL_L_Thigh"] = 58271, 168 | ["FB_L_Brow_Out_000"] = 58331, 169 | ["SKEL_R_Finger00"] = 58866, 170 | ["SKEL_R_Finger10"] = 58867, 171 | ["SKEL_R_Finger20"] = 58868, 172 | ["SKEL_R_Finger30"] = 58869, 173 | ["SKEL_R_Finger40"] = 58870, 174 | ["PH_L_Hand"] = 60309, 175 | ["RB_L_ForeArmRoll"] = 61007, 176 | ["SKEL_L_Forearm"] = 61163, 177 | ["FB_UpperLip_000"] = 61839, 178 | ["SKEL_L_Calf"] = 63931, 179 | ["SKEL_R_Finger01"] = 64016, 180 | ["SKEL_R_Finger02"] = 64017, 181 | ["SKEL_R_Finger31"] = 64064, 182 | ["SKEL_R_Finger32"] = 64065, 183 | ["SKEL_R_Finger41"] = 64080, 184 | ["SKEL_R_Finger42"] = 64081, 185 | ["SKEL_R_Finger11"] = 64096, 186 | ["SKEL_R_Finger12"] = 64097, 187 | ["SKEL_R_Finger21"] = 64112, 188 | ["SKEL_R_Finger22"] = 64113, 189 | ["SKEL_L_Clavicle"] = 64729, 190 | ["FACIAL_facialRoot"] = 65068, 191 | ["IK_L_Foot"] = 65245, 192 | } 193 | 194 | local showBones = false 195 | 196 | RegisterCommand("devbones", function() 197 | showBones = not showBones 198 | if showBones then 199 | Citizen.CreateThread(function() 200 | while showBones do 201 | Citizen.Wait(0) 202 | local pPed = PlayerPedId() 203 | for k, v in pairs(bones) do 204 | local coords = GetPedBoneCoords(pPed, v, 0.0, 0.0, 0.0) 205 | DrawText3D(coords.x, coords.y, coords.z, k) 206 | end 207 | end 208 | end) 209 | end 210 | end, false) 211 | 212 | local showTrafficNodes = false 213 | 214 | RegisterCommand("devtraffic", function() 215 | showTrafficNodes = not showTrafficNodes 216 | if showTrafficNodes then 217 | Citizen.CreateThread(function() 218 | while showTrafficNodes do 219 | Citizen.Wait(0) 220 | for i = 0, 20 do 221 | local node, outPos = GetNthClosestVehicleNode(GetEntityCoords(PlayerPedId()), i, 0, 0.0, 0.0) 222 | if node ~= 0 then 223 | local streetHash = GetStreetNameAtCoord(outPos.x, outPos.y, outPos.z) 224 | local streetName = GetStreetNameFromHashKey(streetHash) 225 | DrawMarker(28, outPos.x, outPos.y, outPos.z, 0.0, 0.0, 0.0, 0, 0, 0, 5.0, 5.0, 5.0, 255, 255, 255, 100, false, true, 2, false, false, false, false) 226 | DrawText3D(outPos.x, outPos.y, outPos.z, streetName) 227 | end 228 | end 229 | end 230 | end) 231 | end 232 | end, false) 233 | 234 | local MaterialHash = { 235 | none = -1, 236 | unk = -1775485061, 237 | concrete = 1187676648, 238 | concrete_pothole = 359120722, 239 | concrete_dusty = -1084640111, 240 | tarmac = 282940568, 241 | tarmac_painted = -1301352528, 242 | tarmac_pothole = 1886546517, 243 | rumble_strip = -250168275, 244 | breeze_block = -954112554, 245 | rock = -840216541, 246 | rock_mossy = -124769592, 247 | stone = 765206029, 248 | cobblestone = 576169331, 249 | brick = 1639053622, 250 | marble = 1945073303, 251 | paving_slab = 1907048430, 252 | sandstone_solid = 592446772, 253 | sandstone_brittle = 1913209870, 254 | sand_loose = -1595148316, 255 | sand_compact = 510490462, 256 | sand_wet = 909950165, 257 | sand_track = -1907520769, 258 | sand_underwater = -1136057692, 259 | sand_dry_deep = 509508168, 260 | sand_wet_deep = 1288448767, 261 | ice = -786060715, 262 | ice_tarmac = -1931024423, 263 | snow_loose = -1937569590, 264 | snow_compact = -878560889, 265 | snow_deep = 1619704960, 266 | snow_tarmac = 1550304810, 267 | gravel_small = 951832588, 268 | gravel_large = 2128369009, 269 | gravel_deep = -356706482, 270 | gravel_train_track = 1925605558, 271 | dirt_track = -1885547121, 272 | mud_hard = -1942898710, 273 | mud_pothole = 312396330, 274 | mud_soft = 1635937914, 275 | mud_underwater = -273490167, 276 | mud_deep = 1109728704, 277 | marsh = 223086562, 278 | marsh_deep = 1584636462, 279 | soil = -700658213, 280 | clay_hard = 1144315879, 281 | clay_soft = 560985072, 282 | grass_long = -461750719, 283 | grass = 1333033863, 284 | grass_short = -1286696947, 285 | hay = -1833527165, 286 | bushes = 581794674, 287 | twigs = -913351839, 288 | leaves = -2041329971, 289 | woodchips = -309121453, 290 | tree_bark = -1915425863, 291 | metal_solid_small = -1447280105, 292 | metal_solid_medium = -365631240, 293 | metal_solid_large = 752131025, 294 | metal_hollow_small = 15972667, 295 | metal_hollow_medium = 1849540536, 296 | metal_hollow_large = -583213831, 297 | metal_chainlink_small = 762193613, 298 | metal_chainlink_large = 125958708, 299 | metal_corrugated_iron = 834144982, 300 | metal_grille = -426118011, 301 | metal_railing = 2100727187, 302 | metal_duct = 1761524221, 303 | metal_garage_door = -231260695, 304 | metal_manhole = -754997699, 305 | wood_solid_small = -399872228, 306 | wood_solid_medium = 555004797, 307 | wood_solid_large = 815762359, 308 | wood_solid_polished = 126470059, 309 | wood_floor_dusty = -749452322, 310 | wood_hollow_small = 1993976879, 311 | wood_hollow_medium = -365476163, 312 | wood_hollow_large = -925419289, 313 | wood_chipboard = 1176309403, 314 | wood_old_creaky = 722686013, 315 | wood_high_density = -1742843392, 316 | wood_lattice = 2011204130, 317 | ceramic = -1186320715, 318 | roof_tile = 1755188853, 319 | roof_felt = -1417164731, 320 | fibreglass = 1354180827, 321 | tarpaulin = -642658848, 322 | plastic = -2073312001, 323 | plastic_hollow = 627123000, 324 | plastic_high_density = -1625995479, 325 | plastic_clear = -1859721013, 326 | plastic_hollow_clear = 772722531, 327 | plastic_high_density_clear = -1338473170, 328 | fibreglass_hollow = -766055098, 329 | rubber = -145735917, 330 | rubber_hollow = -783934672, 331 | linoleum = 289630530, 332 | laminate = 1845676458, 333 | carpet_solid = 669292054, 334 | carpet_solid_dusty = 158576196, 335 | carpet_floorboard = -1396484943, 336 | cloth = 122789469, 337 | plaster_solid = -574122433, 338 | plaster_brittle = -251888898, 339 | cardboard_sheet = 236511221, 340 | cardboard_box = -1409054440, 341 | paper = 474149820, 342 | foam = 808719444, 343 | feather_pillow = 1341866303, 344 | polystyrene = -1756927331, 345 | leather = -570470900, 346 | tvscreen = 1429989756, 347 | slatted_blinds = 673696729, 348 | glass_shoot_through = 937503243, 349 | glass_bulletproof = 244521486, 350 | glass_opaque = 1500272081, 351 | perspex = -1619794068, 352 | car_metal = -93061983, 353 | car_plastic = 2137197282, 354 | car_softtop = -979647862, 355 | car_softtop_clear = 2130571536, 356 | car_glass_weak = 1247281098, 357 | car_glass_medium = 602884284, 358 | car_glass_strong = 1070994698, 359 | car_glass_bulletproof = -1721915930, 360 | car_glass_opaque = 513061559, 361 | water = 435688960, 362 | blood = 5236042, 363 | oil = -634481305, 364 | petrol = -1634184340, 365 | fresh_meat = 868733839, 366 | dried_meat = -1445160429, 367 | emissive_glass = 1501078253, 368 | emissive_plastic = 1059629996, 369 | vfx_metal_electrified = -309134265, 370 | vfx_metal_water_tower = 611561919, 371 | vfx_metal_steam = -691277294, 372 | vfx_metal_flame = 332778253, 373 | phys_no_friction = 1666473731, 374 | phys_golf_ball = -1693813558, 375 | phys_tennis_ball = -256704763, 376 | phys_caster = -235302683, 377 | phys_caster_rusty = 2016463089, 378 | phys_car_void = 1345867677, 379 | phys_ped_capsule = -291631035, 380 | phys_electric_fence = -1170043733, 381 | phys_electric_metal = -2013761145, 382 | phys_barbed_wire = -1543323456, 383 | phys_pooltable_surface = 605776921, 384 | phys_pooltable_cushion = 972939963, 385 | phys_pooltable_ball = -748341562, 386 | buttocks = 483400232, 387 | thigh_left = -460535871, 388 | shin_left = 652772852, 389 | foot_left = 1926285543, 390 | thigh_right = -236981255, 391 | shin_right = -446036155, 392 | foot_right = -1369136684, 393 | spine0 = -1922286884, 394 | spine1 = -1140112869, 395 | spine2 = 1457572381, 396 | spine3 = 32752644, 397 | clavicle_left = -1469616465, 398 | upper_arm_left = -510342358, 399 | lower_arm_left = 1045062756, 400 | hand_left = 113101985, 401 | clavicle_right = -1557288998, 402 | upper_arm_right = 1501153539, 403 | lower_arm_right = 1777921590, 404 | hand_right = 2000961972, 405 | neck = 1718294164, 406 | head = -735392753, 407 | animal_default = 286224918, 408 | car_engine = -1916939624, 409 | puddle = 999829011, 410 | concrete_pavement = 2015599386, 411 | brick_pavement = -1147361576, 412 | phys_dynamic_cover_bound = -2047468855, 413 | vfx_wood_beer_barrel = 998201806, 414 | wood_high_friction = -2140087047, 415 | rock_noinst = 127813971, 416 | bushes_noinst = 1441114862, 417 | metal_solid_road_surface = -729112334, 418 | stunt_ramp_surface = -2088174996, 419 | temp_01 = 746881105, 420 | temp_02 = -1977970111, 421 | temp_03 = 1911121241, 422 | temp_04 = 1923995104, 423 | temp_05 = -1393662448, 424 | temp_06 = 1061250033, 425 | temp_07 = -1765523682, 426 | temp_08 = 1343679702, 427 | temp_09 = 1026054937, 428 | temp_10 = 63305994, 429 | temp_11 = 47470226, 430 | temp_12 = 702596674, 431 | temp_13 = -1637485913, 432 | temp_14 = -645955574, 433 | temp_15 = -1583997931, 434 | temp_16 = -1512735273, 435 | temp_17 = 1011960114, 436 | temp_18 = 1354993138, 437 | temp_19 = -801804446, 438 | temp_20 = -2052880405, 439 | temp_21 = -1037756060, 440 | temp_22 = -620388353, 441 | temp_23 = 465002639, 442 | temp_24 = 1963820161, 443 | temp_25 = 1952288305, 444 | temp_26 = -1116253098, 445 | temp_27 = 889255498, 446 | temp_28 = -1179674098, 447 | temp_29 = 1078418101, 448 | temp_30 = 13626292 449 | } 450 | 451 | local showMaterial = false 452 | 453 | RegisterCommand("devground", function() 454 | showMaterial = not showMaterial 455 | if showMaterial then 456 | Citizen.CreateThread(function() 457 | while showMaterial do 458 | Citizen.Wait(0) 459 | local pPed = PlayerPedId() 460 | local coords = GetEntityCoords(pPed) 461 | local handle = StartShapeTestRay(coords.x, coords.y, coords.z, coords.x, coords.y, coords.z - 2.0, 339, pPed, 0) 462 | local _, _, _, _, materialHash = GetShapeTestResultIncludingMaterial(handle) 463 | local materialName = nil 464 | for k, v in pairs(MaterialHash) do 465 | if v == materialHash then 466 | materialName = k 467 | break 468 | end 469 | end 470 | DrawText3D(coords.x, coords.y, coords.z, tostring(materialName or materialHash)) 471 | end 472 | end) 473 | end 474 | end, false) 475 | 476 | 477 | -- UTILS -- 478 | 479 | 480 | function DrawText3D(x, y, z, text) 481 | local onScreen, _x, _y = GetScreenCoordFromWorldCoord(x, y, z) 482 | if onScreen then 483 | SetTextScale(0.35, 0.35) 484 | SetTextFont(4) 485 | SetTextProportional(true) 486 | SetTextColour(255, 255, 255, 255) 487 | SetTextDropshadow(0, 0, 0, 0, 255) 488 | SetTextEdge(2, 0, 0, 0, 150) 489 | SetTextDropShadow() 490 | SetTextOutline() 491 | SetTextEntry("STRING") 492 | SetTextCentre(true) 493 | AddTextComponentString(text) 494 | DrawText(_x, _y) 495 | end 496 | end 497 | 498 | function DrawBoxAroundEntity(entity) 499 | local model = GetEntityModel(entity) 500 | local maxDim , minDim = GetModelDimensions(model) 501 | local a = GetOffsetFromEntityInWorldCoords(entity, minDim.x, maxDim.y, minDim.z) 502 | local b = GetOffsetFromEntityInWorldCoords(entity, minDim.x, minDim.y, minDim.z) 503 | local c = GetOffsetFromEntityInWorldCoords(entity, maxDim.x, minDim.y, minDim.z) 504 | local d = GetOffsetFromEntityInWorldCoords(entity, maxDim.x, maxDim.y, minDim.z) 505 | local e = GetOffsetFromEntityInWorldCoords(entity, minDim.x, maxDim.y, maxDim.z) 506 | local f = GetOffsetFromEntityInWorldCoords(entity, minDim.x, minDim.y, maxDim.z) 507 | local g = GetOffsetFromEntityInWorldCoords(entity, maxDim.x, minDim.y, maxDim.z) 508 | local h = GetOffsetFromEntityInWorldCoords(entity, maxDim.x, maxDim.y, maxDim.z) 509 | DrawLine(a.x, a.y, a.z, b.x, b.y, b.z, 255, 0, 0, 255) 510 | DrawLine(b.x, b.y, b.z, c.x, c.y, c.z, 255, 0, 0, 255) 511 | DrawLine(c.x, c.y, c.z, d.x, d.y, d.z, 255, 0, 0, 255) 512 | DrawLine(d.x, d.y, d.z, a.x, a.y, a.z, 255, 0, 0, 255) 513 | DrawLine(e.x, e.y, e.z, f.x, f.y, f.z, 255, 0, 0, 255) 514 | DrawLine(f.x, f.y, f.z, g.x, g.y, g.z, 255, 0, 0, 255) 515 | DrawLine(g.x, g.y, g.z, h.x, h.y, h.z, 255, 0, 0, 255) 516 | DrawLine(h.x, h.y, h.z, e.x, e.y, e.z, 255, 0, 0, 255) 517 | DrawLine(a.x, a.y, a.z, e.x, e.y, e.z, 255, 0, 0, 255) 518 | DrawLine(b.x, b.y, b.z, f.x, f.y, f.z, 255, 0, 0, 255) 519 | DrawLine(c.x, c.y, c.z, g.x, g.y, g.z, 255, 0, 0, 255) 520 | DrawLine(d.x, d.y, d.z, h.x, h.y, h.z, 255, 0, 0, 255) 521 | end 522 | 523 | function DrawTxt(text, x, y) 524 | SetTextFont(0) 525 | SetTextProportional(true) 526 | SetTextScale(0.0, 0.4) 527 | SetTextDropshadow(1, 0, 0, 0, 255) 528 | SetTextEdge(1, 0, 0, 0, 255) 529 | SetTextDropShadow() 530 | SetTextOutline() 531 | SetTextEntry("STRING") 532 | AddTextComponentString(text) 533 | EndTextCommandDisplayText(x, y) 534 | end 535 | -------------------------------------------------------------------------------- /fxmanifest.lua: -------------------------------------------------------------------------------- 1 | fx_version 'cerulean' 2 | game 'gta5' 3 | 4 | name "mth-dev-commands" 5 | description "Script that compiles useful development commands" 6 | author "Mathu_lmn" 7 | version "1.0.0" 8 | 9 | client_script 'client.lua' --------------------------------------------------------------------------------