mirror of
https://github.com/citizenfx/cfx-server-data.git
synced 2025-01-10 15:43:00 +08:00
update some stock res
This commit is contained in:
parent
f6ab9bdcbc
commit
fb15ebd508
@ -87,7 +87,7 @@ AddEventHandler('onClientResourceStart', function(res)
|
|||||||
end)
|
end)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
AddEventHandler('onClientResourceStop', function(res)
|
AddEventHandler('onResourceStop', function(res)
|
||||||
if maps[res] then
|
if maps[res] then
|
||||||
TriggerEvent('onClientMapStop', res)
|
TriggerEvent('onClientMapStop', res)
|
||||||
elseif gametypes[res] then
|
elseif gametypes[res] then
|
||||||
|
@ -38,7 +38,7 @@ Citizen.CreateThread(function()
|
|||||||
else killerid = -1
|
else killerid = -1
|
||||||
end
|
end
|
||||||
|
|
||||||
if killer == ped then
|
if killer == ped or killer == -1 then
|
||||||
TriggerEvent('baseevents:onPlayerDied', killertype, { table.unpack(GetEntityCoords(ped)) })
|
TriggerEvent('baseevents:onPlayerDied', killertype, { table.unpack(GetEntityCoords(ped)) })
|
||||||
TriggerServerEvent('baseevents:onPlayerDied', killertype, { table.unpack(GetEntityCoords(ped)) })
|
TriggerServerEvent('baseevents:onPlayerDied', killertype, { table.unpack(GetEntityCoords(ped)) })
|
||||||
hasBeenDead = true
|
hasBeenDead = true
|
||||||
|
@ -3,6 +3,7 @@ client_script 'spawnmanager.lua'
|
|||||||
export 'getRandomSpawnPoint'
|
export 'getRandomSpawnPoint'
|
||||||
export 'spawnPlayer'
|
export 'spawnPlayer'
|
||||||
export 'addSpawnPoint'
|
export 'addSpawnPoint'
|
||||||
|
export 'removeSpawnPoint'
|
||||||
export 'loadSpawns'
|
export 'loadSpawns'
|
||||||
export 'setAutoSpawn'
|
export 'setAutoSpawn'
|
||||||
export 'setAutoSpawnCallback'
|
export 'setAutoSpawnCallback'
|
||||||
|
@ -85,6 +85,8 @@ function loadSpawns(spawnString)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local spawnNum = 1
|
||||||
|
|
||||||
function addSpawnPoint(spawn)
|
function addSpawnPoint(spawn)
|
||||||
-- validate the spawn (position)
|
-- validate the spawn (position)
|
||||||
if not tonumber(spawn.x) or not tonumber(spawn.y) or not tonumber(spawn.z) then
|
if not tonumber(spawn.x) or not tonumber(spawn.y) or not tonumber(spawn.z) then
|
||||||
@ -117,8 +119,24 @@ function addSpawnPoint(spawn)
|
|||||||
-- overwrite the model in case we hashed it
|
-- overwrite the model in case we hashed it
|
||||||
spawn.model = model
|
spawn.model = model
|
||||||
|
|
||||||
|
-- add an index
|
||||||
|
spawn.idx = spawnNum
|
||||||
|
spawnNum = spawnNum + 1
|
||||||
|
|
||||||
-- all OK, add the spawn entry to the list
|
-- all OK, add the spawn entry to the list
|
||||||
table.insert(spawnPoints, spawn)
|
table.insert(spawnPoints, spawn)
|
||||||
|
|
||||||
|
return spawn.idx
|
||||||
|
end
|
||||||
|
|
||||||
|
-- removes a spawn point
|
||||||
|
function removeSpawnPoint(spawn)
|
||||||
|
for i = 1, #spawnPoints do
|
||||||
|
if spawnPoints[i].idx == spawn then
|
||||||
|
table.remove(spawnPoints, i)
|
||||||
|
return
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- changes the auto-spawn flag
|
-- changes the auto-spawn flag
|
||||||
|
Loading…
Reference in New Issue
Block a user