ifne
June 12, 2018, 3:23pm
1
how or what would i place into my menu to trigger a car spawn? - WL9 is the spawn name - its for a menu
local hash = GetHashKey(“wl9”)
RequestModel(hash)
while not HasModelLoaded(hash) do
RequestModel(hash)
Citizen.Wait(0)
end
local x, y, z = table.unpack(GetEntityCoords(GetPlayerPed(-1), false))
local vehicle = CreateVehicle(hash, x + 2, y + 2, z + 1, 0.0, true, false)
ifne
June 12, 2018, 3:40pm
2
ifne:
local hash = GetHashKey(“wl9”)
RequestModel(hash)
while not HasModelLoaded(hash) do
RequestModel(hash)
Citizen.Wait(0)
end
local x, y, z = table.unpack(GetEntityCoords(GetPlayerPed(-1), false))
local vehicle = CreateVehicle(hash, x + 2, y + 2, z + 1, 0.0, true, false)
would it be
AddEventHandler("chatMessage",function(Source,Name,Msg)
if Msg:sub(1,6) == "/wl9" then
TriggerClientEvent("Event",Source,Msg:sub(5))
CancelEvent()
end
end)
-- Client
RegisterNetEvent("Event")
AddEventHandler("Event",function(Vehicle)
-- Code
end
FAXES
June 12, 2018, 4:03pm
3
Try
RegisterCommand('wl9', function(source, args, rawCommand)
local x,y,z = table.unpack(GetOffsetFromEntityInWorldCoords(PlayerPedId(), 0.0, 8.0, 0.5))
vehiclehash = "wl9"
RequestModel(vehiclehash)
Citizen.CreateThread(function()
CreateVehicle(vehiclehash, x, y, z, GetEntityHeading(PlayerPedId())+90, 1, 0)
end)
end)
Might not work idk, just wrote it in about 10 seconds
Also in future to format code use the (`) symbol to format it.
View the below to see more, I kinda based mine off of it, but this is a script you might like
Update 17-12-2018
I will no longer be maintaining/supporting this resource. The GitHub repo has been archived. Fork it if you want to update it yourself.
This is just a simple resource which you can use to spawn any car in front of you. I noticed some people having issues using this (old) topic so decided to upload my own version which i made a few weeks ago but never released it.
Feel free to edit this as you see fit. I will NOT be updating this with any feature requests.
Commands
/car <ve…
ifne
June 12, 2018, 4:05pm
4
cheers thanks alot i shall give it ago
ifne
June 12, 2018, 4:09pm
5
nope shame,
i was trying to get it to work with this great menu -
ui.css (548 Bytes)
README.md (633 Bytes)
cl_toolbox.lua (65.8 KB)
LICENSE (34.4 KB)
ui.html (13.5 KB)
ui.js (2.5 KB)
__resource.lua (881 Bytes)
sv_toolbox.lua (4.8 KB)
ifne
June 12, 2018, 7:48pm
6
so still this in and it will work or chance the “red” bits
ifne
June 19, 2018, 9:01am
7
would you know how to spawn Cones and barriers with a trigerevent?
FAXES
June 19, 2018, 9:29am
8
There’s scripts that have been released for this
ifne
June 19, 2018, 9:50am
9
yes but none work and woundered what i did wrong,
would you mind pointing the error out - pretty please
cl_toolbox.lua (98.0 KB)
ifne
June 19, 2018, 9:53am
11
cheers i shall have a look
1 Like