Table setup
Create or modify poker table positions with the included placement command.
Placement command
The /createpokertable command is registered in config.lua.
caution
This is a client-side command, so any player can use it to spawn tables locally. After creating your table positions, remove the command from config.lua.
After using the command, the table position and rotation are printed in the client console.
config.lua
RegisterCommand('createpokertable', function()
if DoesEntityExist(testTable) then
return
end
local pokermodel = 'pokerasztal'
RequestModel(pokermodel)
while not HasModelLoaded(pokermodel) do
print('not exist')
Citizen.Wait(100)
end
testTable = CreateObject(pokermodel, GetEntityCoords(PlayerPedId()), false, false, false)
SetEntityHeading(testTable, GetEntityHeading(PlayerPedId()))
PlaceObjectOnGroundProperly(testTable)
Citizen.Wait(1000)
local pos = GetEntityCoords(testTable)
local _, groundZ, offsets = GetGroundZCoordWithOffsets(pos.x, pos.y, pos.z)
print(vector3(pos.x, pos.y, groundZ))
print(GetEntityHeading(testTable))
Citizen.Wait(2500)
if DoesEntityExist(testTable) then
DeleteObject(testTable)
end
end)
Table positions
Add the position and rotation values from the client console to Config.PokerTables. Use a different id for every table.
config.lua
Config.PokerTables = {
{ id = 1, pos = vector3(1111.128, 217.078, -50.440), heading = 165.9, blind = 20 },
{ id = 2, pos = vector3(1104.686, 208.9376, -50.440), heading = 56.8, blind = 100 }
}