Need help creating/finding a script for FiveM Server

Hi there guys, currently need help with our current vehicle spawning system. We have everything set-up so we’re able to spawn in vehicles but we want to be able to set the spawn point to the player through their ID? So for example

Player ID 20 has purchased a server addon vehicle. We want to be able to give them the car and spawn it on them by using their player ID using either our admin menu or some form of simple way.

Does anyone have an idea or resource for this?

From the Docs: GetEntityCoords - Natives @ Cfx.re Docs

local function ShowCoordinates()
    local player = source
    local ped = GetPlayerPed(player)
    local playerCoords = GetEntityCoords(ped)

    print(playerCoords) -- vector3(...)
end

Long story-short, you can use GetPlayerPed() and GetEntityCoords() on server-side too

1 Like