Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

changed GetPlayerPed(-1) with PlayerPedId() #1

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions Omi-spawn/client.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand All @@ -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

Expand All @@ -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

Expand All @@ -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)

Expand All @@ -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"]

Expand All @@ -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
Expand All @@ -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
Expand All @@ -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')
Expand All @@ -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
Expand Down Expand Up @@ -273,4 +273,4 @@ AddEventHandler('Omi-spawn:client:setupSpawns', function(cData, new, apps)
locations = apps,
})
end
end)
end)