mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-05 06:28:51 +00:00
(Fix): Fixed vehicle tornado.
This commit is contained in:
1 parent
76742f3cb4
commit
ff0c1bca87
1 file changed
+9
@@ -31,10 +31,12 @@ 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.
|
||||||
|
if propCreated == false then
|
||||||
RequestModel(phoneModel)
|
RequestModel(phoneModel)
|
||||||
while not HasModelLoaded(phoneModel) do
|
while not HasModelLoaded(phoneModel) do
|
||||||
Citizen.Wait(1)
|
Citizen.Wait(1)
|
||||||
@@ -45,6 +47,11 @@ function newPhoneProp() -- Function for creating the phone prop
|
|||||||
prop = CreateObject(GetHashKey(phoneModel), x, y, z + 0.2, true, true, true)
|
prop = CreateObject(GetHashKey(phoneModel), x, y, z + 0.2, true, true, true)
|
||||||
local boneIndex = GetPedBoneIndex(playerPed, 28422)
|
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.
|
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
|
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.
|
||||||
@@ -118,6 +125,8 @@ function deletePhone() -- Triggered in newphoneProp function. Only way to destor
|
|||||||
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