Vehicle Spawn Log

Has anyone made a script that tells me the steam id of the person that is spawning shit in

Not possible at this time (From what I’m aware) however I’m pretty sure one of the elements said something about adding hooks to events for OneSync.

We need this ASAP

2 Likes

Here is an example of how you can create a script that retrieves the Steam ID of a player who is spawning items in your FiveM server:

code

-- Listen for the "playerSpawnedObject" event
AddEventHandler("playerSpawnedObject", function(obj)
    -- Get the player who spawned the object
    local player = source
    -- Get the player's name
    local playerName = GetPlayerName(player)
    -- Get the player's Steam ID
    local playerSteamID = GetPlayerIdentifiers(player)[1]
    -- Print the player's name and Steam ID to the console
    print(playerName .. " with Steam ID " .. playerSteamID .. " spawned an object.")
end)

You can add this script to your server’s “client.lua” file, or create a new file and include it in your server’s configuration.

Please note that this script uses the “AddEventHandler” function to listen for the “playerSpawnedObject” event which is triggered when a player spawns an object in the game, you can use this event to detect when a player is spawning items.

Also, the GetPlayerIdentifiers(player)[1] is used to get the steam id of the player, it’s the first identifier of the player in the returned table.

please credit me if it works
:slight_smile: