mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-04 22:16:40 +00:00
(Temp): Removed prop from veh
This commit is contained in:
1 parent
ff0c1bca87
commit
95e8050d16
1 file changed
+12
-10
@@ -40,11 +40,13 @@ function newPhoneProp() -- Function for creating the phone prop
|
|||||||
RequestModel(phoneModel)
|
RequestModel(phoneModel)
|
||||||
while not HasModelLoaded(phoneModel) do
|
while not HasModelLoaded(phoneModel) do
|
||||||
Citizen.Wait(1)
|
Citizen.Wait(1)
|
||||||
|
print("MODEL HASNT LOADED")
|
||||||
end
|
end
|
||||||
|
|
||||||
local playerPed = GetPlayerPed(-1)
|
local playerPed = GetPlayerPed(-1)
|
||||||
local x,y,z = table.unpack(GetEntityCoords(playerPed))
|
local x,y,z = table.unpack(GetEntityCoords(playerPed))
|
||||||
prop = CreateObject(GetHashKey(phoneModel), x, y, z + 0.2, true, true, true)
|
prop = CreateObject(GetHashKey(phoneModel), x, y, z + 0.2, true, true, true)
|
||||||
|
--prop = CreateObject(GetHashKey(phoneModel), 1.0, 1.0, 1.0, 1, 1, 0)
|
||||||
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
|
propCreated = true
|
||||||
@@ -54,6 +56,15 @@ function newPhoneProp() -- Function for creating the phone prop
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function deletePhone() -- Triggered in newphoneProp function. Only way to destory the prop correctly.
|
||||||
|
if prop ~= 0 then
|
||||||
|
Citizen.InvokeNative(0xAE3CBE5BF394C9C9 , Citizen.PointerValueIntInitialized(prop))
|
||||||
|
prop = 0
|
||||||
|
propCreated = false
|
||||||
|
print("prop destroyed")
|
||||||
|
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.
|
||||||
while ( not HasAnimDictLoaded(dict)) do
|
while ( not HasAnimDictLoaded(dict)) do
|
||||||
RequestAnimDict(dict)
|
RequestAnimDict(dict)
|
||||||
@@ -74,7 +85,7 @@ function phoneOpenAnim() --Phone Open Animation
|
|||||||
loadAnimDict(dict)
|
loadAnimDict(dict)
|
||||||
TaskPlayAnim(GetPlayerPed(-1), dict, 'cellphone_text_in', 8.0, -1, -1, flag, 0, false, false, false)
|
TaskPlayAnim(GetPlayerPed(-1), dict, 'cellphone_text_in', 8.0, -1, -1, flag, 0, false, false, false)
|
||||||
Wait(300) -- Gives time for animation starts before creating the phone
|
Wait(300) -- Gives time for animation starts before creating the phone
|
||||||
newPhoneProp() -- Creates the phone and attaches it.
|
--newPhoneProp() -- Creates the phone and attaches it.
|
||||||
else -- While not in a vehicle it will use this dict.
|
else -- While not in a vehicle it will use this dict.
|
||||||
local dict = 'cellphone@'
|
local dict = 'cellphone@'
|
||||||
local kek = "pepeout"
|
local kek = "pepeout"
|
||||||
@@ -121,15 +132,6 @@ function phoneCloseAnim() --Phone Close Animation
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function deletePhone() -- Triggered in newphoneProp function. Only way to destory the prop correctly.
|
|
||||||
if prop ~= 0 then
|
|
||||||
Citizen.InvokeNative(0xAE3CBE5BF394C9C9 , Citizen.PointerValueIntInitialized(prop))
|
|
||||||
prop = 0
|
|
||||||
propCreated = false
|
|
||||||
print("prop destroyed")
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
Citizen.CreateThread(function()
|
Citizen.CreateThread(function()
|
||||||
while true do
|
while true do
|
||||||
Citizen.Wait(0)
|
Citizen.Wait(0)
|
||||||
|
|||||||
Reference in new issue
Block a user