From f47bac26845fb73c141e7290dbc9472c85f337b8 Mon Sep 17 00:00:00 2001 From: mohammed farhan <80166282+firinggamers@users.noreply.github.com> Date: Sun, 20 Mar 2022 22:36:55 +0530 Subject: [PATCH] changed GetPlayerPed(-1) with PlayerPedId() --- Omi-spawn/client.lua | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/Omi-spawn/client.lua b/Omi-spawn/client.lua index 055a01b..e195d1e 100644 --- a/Omi-spawn/client.lua +++ b/Omi-spawn/client.lua @@ -13,7 +13,7 @@ local choosingSpawn = false RegisterNetEvent('Omi-spawn:client:openUI') AddEventHandler('Omi-spawn:client:openUI', function(value) - SetEntityVisible(GetPlayerPed(-1), false) + SetEntityVisible(PlayerPedId(), false) DoScreenFadeOut(250) Citizen.Wait(1000) DoScreenFadeIn(250) @@ -68,7 +68,7 @@ RegisterNUICallback('setCam', function(data) cam = CreateCamWithParams("DEFAULT_SCRIPTED_CAMERA", PlayerData.position.x, PlayerData.position.y, PlayerData.position.z + camZPlus2, 300.00,0.00,0.00, 110.00, false, 0) PointCamAtCoord(cam, PlayerData.position.x, PlayerData.position.y, PlayerData.position.z + pointCamCoords2) SetCamActiveWithInterp(cam, cam2, cam2Time, true, true) - SetEntityCoords(GetPlayerPed(-1), PlayerData.position.x, PlayerData.position.y, PlayerData.position.z) + SetEntityCoords(PlayerPedId(), PlayerData.position.x, PlayerData.position.y, PlayerData.position.z) end) elseif type == "house" then local campos = Config.Houses[location].coords.enter @@ -84,7 +84,7 @@ RegisterNUICallback('setCam', function(data) cam = CreateCamWithParams("DEFAULT_SCRIPTED_CAMERA", campos.x, campos.y, campos.z + camZPlus2, 300.00,0.00,0.00, 110.00, false, 0) PointCamAtCoord(cam, campos.x, campos.y, campos.z + pointCamCoords2) SetCamActiveWithInterp(cam, cam2, cam2Time, true, true) - SetEntityCoords(GetPlayerPed(-1), campos.x, campos.y, campos.z) + SetEntityCoords(PlayerPedId(), campos.x, campos.y, campos.z) elseif type == "normal" then local campos = QB.Spawns[location].coords @@ -99,7 +99,7 @@ RegisterNUICallback('setCam', function(data) cam = CreateCamWithParams("DEFAULT_SCRIPTED_CAMERA", campos.x, campos.y, campos.z + camZPlus2, 300.00,0.00,0.00, 110.00, false, 0) PointCamAtCoord(cam, campos.x, campos.y, campos.z + pointCamCoords2) SetCamActiveWithInterp(cam, cam2, cam2Time, true, true) - SetEntityCoords(GetPlayerPed(-1), campos.x, campos.y, campos.z) + SetEntityCoords(PlayerPedId(), campos.x, campos.y, campos.z) elseif type == "appartment" then local campos = Apartments.Locations[location].coords.enter @@ -114,7 +114,7 @@ RegisterNUICallback('setCam', function(data) cam = CreateCamWithParams("DEFAULT_SCRIPTED_CAMERA", campos.x, campos.y, campos.z + camZPlus2, 300.00,0.00,0.00, 110.00, false, 0) PointCamAtCoord(cam, campos.x, campos.y, campos.z + pointCamCoords2) SetCamActiveWithInterp(cam, cam2, cam2Time, true, true) - SetEntityCoords(GetPlayerPed(-1), campos.x, campos.y, campos.z) + SetEntityCoords(PlayerPedId(), campos.x, campos.y, campos.z) end end) @@ -133,13 +133,13 @@ RegisterNUICallback('chooseAppa', function(data) DestroyCam(cam, true) SetCamActive(cam2, false) DestroyCam(cam2, true) - SetEntityVisible(GetPlayerPed(-1), true) + SetEntityVisible(PlayerPedId(), true) end) RegisterNUICallback('spawnplayer', function(data) local location = tostring(data.spawnloc) local type = tostring(data.typeLoc) - local ped = GetPlayerPed(-1) + local ped = PlayerPedId() local PlayerData = QBCore.Functions.GetPlayerData() local insideMeta = PlayerData.metadata["inside"] @@ -151,9 +151,9 @@ RegisterNUICallback('spawnplayer', function(data) DoScreenFadeOut(500) Citizen.Wait(2000) QBCore.Functions.GetPlayerData(function(PlayerData) - SetEntityCoords(GetPlayerPed(-1), PlayerData.position.x, PlayerData.position.y, PlayerData.position.z) - SetEntityHeading(GetPlayerPed(-1), PlayerData.position.a) - FreezeEntityPosition(GetPlayerPed(-1), false) + SetEntityCoords(PlayerPedId(), PlayerData.position.x, PlayerData.position.y, PlayerData.position.z) + SetEntityHeading(PlayerPedId(), PlayerData.position.a) + FreezeEntityPosition(PlayerPedId(), false) end) print(insideMeta.apartment.apartmentType) if insideMeta.house ~= nil then @@ -172,7 +172,7 @@ RegisterNUICallback('spawnplayer', function(data) DestroyCam(cam, true) SetCamActive(cam2, false) DestroyCam(cam2, true) - SetEntityVisible(GetPlayerPed(-1), true) + SetEntityVisible(PlayerPedId(), true) Citizen.Wait(500) DoScreenFadeIn(250) elseif type == "house" then @@ -190,7 +190,7 @@ RegisterNUICallback('spawnplayer', function(data) DestroyCam(cam, true) SetCamActive(cam2, false) DestroyCam(cam2, true) - SetEntityVisible(GetPlayerPed(-1), true) + SetEntityVisible(PlayerPedId(), true) Citizen.Wait(500) DoScreenFadeIn(250) print('house') @@ -214,7 +214,7 @@ RegisterNUICallback('spawnplayer', function(data) DestroyCam(cam, true) SetCamActive(cam2, false) DestroyCam(cam2, true) - SetEntityVisible(GetPlayerPed(-1), true) + SetEntityVisible(PlayerPedId(), true) Citizen.Wait(500) DoScreenFadeIn(250) end @@ -273,4 +273,4 @@ AddEventHandler('Omi-spawn:client:setupSpawns', function(cData, new, apps) locations = apps, }) end -end) \ No newline at end of file +end)