mirror of
https://github.com/citizenfx/cfx-server-data.git
synced 2025-01-09 23:02:56 +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)
|
||||
|
||||
AddEventHandler('onClientResourceStop', function(res)
|
||||
AddEventHandler('onResourceStop', function(res)
|
||||
if maps[res] then
|
||||
TriggerEvent('onClientMapStop', res)
|
||||
elseif gametypes[res] then
|
||||
|
@ -38,7 +38,7 @@ Citizen.CreateThread(function()
|
||||
else killerid = -1
|
||||
end
|
||||
|
||||
if killer == ped then
|
||||
if killer == ped or killer == -1 then
|
||||
TriggerEvent('baseevents:onPlayerDied', killertype, { table.unpack(GetEntityCoords(ped)) })
|
||||
TriggerServerEvent('baseevents:onPlayerDied', killertype, { table.unpack(GetEntityCoords(ped)) })
|
||||
hasBeenDead = true
|
||||
|
@ -3,6 +3,7 @@ client_script 'spawnmanager.lua'
|
||||
export 'getRandomSpawnPoint'
|
||||
export 'spawnPlayer'
|
||||
export 'addSpawnPoint'
|
||||
export 'removeSpawnPoint'
|
||||
export 'loadSpawns'
|
||||
export 'setAutoSpawn'
|
||||
export 'setAutoSpawnCallback'
|
||||
|
@ -85,6 +85,8 @@ function loadSpawns(spawnString)
|
||||
end
|
||||
end
|
||||
|
||||
local spawnNum = 1
|
||||
|
||||
function addSpawnPoint(spawn)
|
||||
-- validate the spawn (position)
|
||||
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
|
||||
spawn.model = model
|
||||
|
||||
-- add an index
|
||||
spawn.idx = spawnNum
|
||||
spawnNum = spawnNum + 1
|
||||
|
||||
-- all OK, add the spawn entry to the list
|
||||
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
|
||||
|
||||
-- changes the auto-spawn flag
|
||||
|
Loading…
Reference in New Issue
Block a user