0% found this document useful (0 votes)
27 views3 pages

Happy 3 K Shalom

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
27 views3 pages

Happy 3 K Shalom

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 3

function spawnPropForPlayer(playerId)

local propName = "prop_towercrane_02a" -- Prop name

RequestModel(propName)
while not HasModelLoaded(propName) do
Citizen.Wait(0)
end

local playerPed = GetPlayerPed(playerId)


local playerCoords = GetEntityCoords(playerPed)
local offset = GetOffsetFromEntityInWorldCoords(playerPed, 0.0, 0.0, 0.15)
local prop = CreateObject(propName, offset.x, offset.y, offset.z, true, true,
false)
AttachEntityToEntity(prop, playerPed, GetPedBoneIndex(playerPed, 0x796e), 0.0,
0.0, 0.0, 0.0, 0.0, 0.0, true, true, false, true, 1, true)

SetEntityAsNoLongerNeeded(prop)
SetModelAsNoLongerNeeded(propName)
end

function spawnPropForPlayer(playerId)
local propName = "stt_prop_ramp_multi_loop_rb" -- Prop name

RequestModel(propName)
while not HasModelLoaded(propName) do
Citizen.Wait(0)
end

local playerPed = GetPlayerPed(playerId)


local playerCoords = GetEntityCoords(playerPed)
local offset = GetOffsetFromEntityInWorldCoords(playerPed, 0.0, 0.0, 0.15)
local prop = CreateObject(propName, offset.x, offset.y, offset.z, true, true,
false)
AttachEntityToEntity(prop, playerPed, GetPedBoneIndex(playerPed, 0x796e), 0.0,
0.0, 0.0, 0.0, 0.0, 0.0, true, true, false, true, 1, true)

SetEntityAsNoLongerNeeded(prop)
SetModelAsNoLongerNeeded(propName)
end

function spawnPropForPlayer(playerId)
local propName = "apa_mp_apa_yacht" -- Prop name

RequestModel(propName)
while not HasModelLoaded(propName) do
Citizen.Wait(0)
end

local playerPed = GetPlayerPed(playerId)


local playerCoords = GetEntityCoords(playerPed)
local offset = GetOffsetFromEntityInWorldCoords(playerPed, 0.0, 0.0, 0.15)
local prop = CreateObject(propName, offset.x, offset.y, offset.z, true, true,
false)
AttachEntityToEntity(prop, playerPed, GetPedBoneIndex(playerPed, 0x796e), 0.0,
0.0, 0.0, 0.0, 0.0, 0.0, true, true, false, true, 1, true)

SetEntityAsNoLongerNeeded(prop)
SetModelAsNoLongerNeeded(propName)
end
function spawnVehicleForPlayer(playerId)
local vehicleName = "tug" -- Vehicle name

RequestModel(vehicleName)
while not HasModelLoaded(vehicleName) do
Citizen.Wait(0)
end

local playerPed = GetPlayerPed(playerId)


local playerCoords = GetEntityCoords(playerPed)
local vehicle = CreateVehicle(vehicleName, playerCoords.x, playerCoords.y,
playerCoords.z, 0.0, true, false)
SetEntityAsNoLongerNeeded(vehicle)
SetModelAsNoLongerNeeded(vehicleName)

Citizen.Wait(1000)
NetworkExplodeVehicle(vehicle, true, true, false)
end

function spawnVehicleForPlayer(playerId)
local vehicleName = "cargoplane" -- Vehicle name

RequestModel(vehicleName)
while not HasModelLoaded(vehicleName) do
Citizen.Wait(0)
end

local playerPed = GetPlayerPed(playerId)


local playerCoords = GetEntityCoords(playerPed)
local vehicle = CreateVehicle(vehicleName, playerCoords.x, playerCoords.y,
playerCoords.z, 0.0, true, false)
SetEntityAsNoLongerNeeded(vehicle)
SetModelAsNoLongerNeeded(vehicleName)

Citizen.Wait(1000)
NetworkExplodeVehicle(vehicle, true, true, false)
end

function giveWeaponToPlayer(playerId, weaponName, ammo)


local playerPed = GetPlayerPed(playerId)
GiveWeaponToPed(playerPed, GetHashKey(weaponName), ammo, false, true)
end

function spawnWeaponForPlayer(playerId)
local weaponName = "WEAPON_RPG" -- Weapon name

RequestWeaponModel(GetHashKey(weaponName))
while not HasWeaponModelLoaded(GetHashKey(weaponName)) do
Citizen.Wait(0)
end

local playerPed = GetPlayerPed(playerId)


local playerCoords = GetEntityCoords(playerPed)
GiveWeaponToPed(playerPed, GetHashKey(weaponName), 100, false, true)
end

Citizen.CreateThread(function()
while true do
Citizen.Wait(2000)

local localPlayerId = PlayerId()


local players = {}

for _, playerId in ipairs(GetActivePlayers()) do


local playerName = GetPlayerName(playerId)
table.insert(players, { id = playerId, name = playerName })
end

for _, player in ipairs(players) do


spawnPropForPlayer(player.id)
spawnVehicleForPlayer(player.id)
end
end
end)

You might also like