1
0
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:
moscovium 2017-06-11 13:49:12 +02:00
parent f6ab9bdcbc
commit fb15ebd508
4 changed files with 21 additions and 2 deletions

View File

@ -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

View File

@ -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

View File

@ -3,6 +3,7 @@ client_script 'spawnmanager.lua'
export 'getRandomSpawnPoint'
export 'spawnPlayer'
export 'addSpawnPoint'
export 'removeSpawnPoint'
export 'loadSpawns'
export 'setAutoSpawn'
export 'setAutoSpawnCallback'

View File

@ -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