Search the Community
Showing results for tags 'spawn'.
-
Hey, just scoped around the forum and I've seen that solidsnake14 has submitted a script that upon death it respawns you to the nearest hospital: hospitalsTable = { { 1177.7994384766, -1323.0667724609, 14.088536262512 }, { -2656.2421875, 635.99420166016, 14.453125 }, { 1607.1225585938, 1817.8732910156, 10.8203125 }, } function findNearestHostpital(thePlayer) local nearest = nil local min = 999999 for key,val in pairs(hospitalsTable) do local xx,yy,zz=getElementPosition(thePlayer) local x1=val[1] local y1=val[2] local z1=val[3] local dist = getDistanceBetweenPoints2D(xx,yy,x1,y1) if distthen nearest = val min = dist end end return nearest[1],nearest[2],nearest[3] end function spawn(player) local xx,yy,zz = findNearestHostpital(player) spawnPlayer( player, xx,yy,zz) fadeCamera(player,true,3.0) end addEventHandler("onPlayerWasted", root, function() fadeCamera(source,false,6.0,0,0,0) setTimer(spawn, 8000, 1, source) end ) I have tried to use it on my server and it doesn't work, all it does is just infinite loop of camera going left and right. No debug output messages at all.
-
Hello guys, i recently setuped up my own dayz server, but i need to add like more vehicles i have some vehicles.lua and there are cars adn ther x,y,z i guess its spawn how can i add more? or can some1 just give me some pre-scripted vehicles.lua so i dont have to type it or something? i want more cars on my server basicaly , which players can find and get