mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-04 22:16:40 +00:00
(Fix): Fixed vehicle tornado.
This commit is contained in:
1 parent
76742f3cb4
commit
ff0c1bca87
1 file changed
+19
-10
@@ -31,20 +31,27 @@ end, false)]]
|
|||||||
----
|
----
|
||||||
local prop = 0
|
local prop = 0
|
||||||
local isPhoneOpen = false
|
local isPhoneOpen = false
|
||||||
|
local propCreated = false
|
||||||
local phoneModel = "prop_amb_phone" -- Refered to in newphoneProp function. Requires custom phone being streamed.
|
local phoneModel = "prop_amb_phone" -- Refered to in newphoneProp function. Requires custom phone being streamed.
|
||||||
|
|
||||||
function newPhoneProp() -- Function for creating the phone prop
|
function newPhoneProp() -- Function for creating the phone prop
|
||||||
deletePhone() -- deletes the already existing prop before creating another.
|
deletePhone() -- deletes the already existing prop before creating another.
|
||||||
RequestModel(phoneModel)
|
if propCreated == false then
|
||||||
while not HasModelLoaded(phoneModel) do
|
RequestModel(phoneModel)
|
||||||
Citizen.Wait(1)
|
while not HasModelLoaded(phoneModel) do
|
||||||
|
Citizen.Wait(1)
|
||||||
|
end
|
||||||
|
|
||||||
|
local playerPed = GetPlayerPed(-1)
|
||||||
|
local x,y,z = table.unpack(GetEntityCoords(playerPed))
|
||||||
|
prop = CreateObject(GetHashKey(phoneModel), x, y, z + 0.2, true, true, true)
|
||||||
|
local boneIndex = GetPedBoneIndex(playerPed, 28422)
|
||||||
|
AttachEntityToEntity(prop, playerPed, boneIndex, 28422, 0.0, 0.0, 0.0, 0.0, 0.0, -.0, true, true, false, true, 1, true) -- Attaches the phone to the player.
|
||||||
|
propCreated = true
|
||||||
|
print("prop created")
|
||||||
|
elseif propCreated == true then
|
||||||
|
print("prop already created")
|
||||||
end
|
end
|
||||||
|
|
||||||
local playerPed = GetPlayerPed(-1)
|
|
||||||
local x,y,z = table.unpack(GetEntityCoords(playerPed))
|
|
||||||
prop = CreateObject(GetHashKey(phoneModel), x, y, z + 0.2, true, true, true)
|
|
||||||
local boneIndex = GetPedBoneIndex(playerPed, 28422)
|
|
||||||
AttachEntityToEntity(prop, playerPed, boneIndex, 28422, 0.0, 0.0, 0.0, 0.0, 0.0, -.0, true, true, false, true, 1, true) -- Attaches the phone to the player.
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function loadAnimDict(dict) -- Loads the animation dict. Used in the anim functions.
|
function loadAnimDict(dict) -- Loads the animation dict. Used in the anim functions.
|
||||||
@@ -117,7 +124,9 @@ end
|
|||||||
function deletePhone() -- Triggered in newphoneProp function. Only way to destory the prop correctly.
|
function deletePhone() -- Triggered in newphoneProp function. Only way to destory the prop correctly.
|
||||||
if prop ~= 0 then
|
if prop ~= 0 then
|
||||||
Citizen.InvokeNative(0xAE3CBE5BF394C9C9 , Citizen.PointerValueIntInitialized(prop))
|
Citizen.InvokeNative(0xAE3CBE5BF394C9C9 , Citizen.PointerValueIntInitialized(prop))
|
||||||
prop = 0
|
prop = 0
|
||||||
|
propCreated = false
|
||||||
|
print("prop destroyed")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user