Advertisement
glitchdetector

omni_conductor/server.lua

Aug 5th, 2018
213
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.71 KB | None | 0 0
  1. TrainList = {} -- Not tested with more than one person...
  2. -- Should work? Couldn't find a diff way to track spawned trains, or any trains at all!
  3.  
  4. RegisterServerEvent("hardcap:playerActivated")
  5. AddEventHandler('hardcap:playerActivated', function()
  6.     TriggerClientEvent("UpdateTrainList",-1, TrainList, false)
  7.     print("Sending list to new client")
  8. end)
  9.  
  10. RegisterServerEvent("AddToTrainList")
  11. AddEventHandler('AddToTrainList', function(Train)
  12.     table.insert(TrainList,Train)
  13.     TriggerClientEvent("UpdateTrainList",-1, TrainList)
  14. end)
  15.  
  16. RegisterServerEvent("DeleteTrains")
  17. AddEventHandler('DeleteTrains', function(Train)
  18.     TrainList = {}
  19.     print("Sending Delete")
  20.     TriggerClientEvent("UpdateTrainList", -1, {}, true)
  21. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement