kevincouto6 Posted March 28, 2018 Share Posted March 28, 2018 Hello I wanted to ask for help, I want to add come on my map but those of the publishers can not respanw after destroyed someone could help me? Link to comment
Discord Moderators Pirulax Posted March 29, 2018 Discord Moderators Share Posted March 29, 2018 What? I cant understand ur question. Link to comment
kevincouto6 Posted April 1, 2018 Author Share Posted April 1, 2018 On 29/03/2018 at 16:18, Pirulax said: What? I cant understand ur question. I wanted a script to create cars and freeze them Link to comment
Discord Moderators Pirulax Posted April 2, 2018 Discord Moderators Share Posted April 2, 2018 Why would you create a car, and freeze it afterwards? Link to comment
kevincouto6 Posted April 3, 2018 Author Share Posted April 3, 2018 I created a map in the ocean, but they are falling in the ocean before loading the map, so I must freeze the vehicles. Link to comment
Moderators Patrick Posted April 4, 2018 Moderators Share Posted April 4, 2018 Create vehicles with different script. Link to comment
kevincouto6 Posted April 4, 2018 Author Share Posted April 4, 2018 could you send me a script for this? Link to comment
Moderators Patrick Posted April 4, 2018 Moderators Share Posted April 4, 2018 (edited) 1 hour ago, kevincouto6 said: could you send me a script for this? -- SERVER SIDE SCRIPT!! local vehspawns = { {500,0,0,5,0,0,0, true}, -- example (spawn a freezed vehicle to the farm) -- {vehiclemodelid, posx,posy,posz, rotx,roty,rotz, freezeonspawn}, } function createVehToSpawn(vehiclemodelid, posx,posy,posz, rotx,roty,rotz, freezeonspawn) local veh = createVehicle(vehiclemodelid, posx,posy,posz, rotx,roty,rotz) setElementData(veh, "tablerow", {vehiclemodelid, posx,posy,posz, rotx,roty,rotz, freezeonspawn}) addEventHandler("onVehicleExplode", veh, respawnVehicle) if freezeonspawn then setElementFrozen(veh, true) addEventHandler("onVehicleEnter", veh, function() setElementFrozen(source, false) end) addEventHandler("onVehicleExit", veh, function() setElementFrozen(source, true) end) end end function respawnVehicle() local v = getElementData(source, "tablerow") if not v then return end if v[8] then removeEventHandler("onVehicleEnter", source, function() setElementFrozen(source, false) end) removeEventHandler("onVehicleExit", source, function() setElementFrozen(source, true) end) end destroyElement(source) createVehToSpawn(v[1], v[2], v[3], v[4], v[5], v[6], v[7], v[8]) -- create back the destroyed vehicle end for i, v in ipairs(vehspawns) do createVehToSpawn(v[1], v[2], v[3], v[4], v[5], v[6], v[7], v[8]) -- spawn vehicles on script start end Set 'freezeonspawn' to true and the vehicles are not falling to the oceon. (Use 'false' to disable it.) Edited April 4, 2018 by Patrick2562 Link to comment
kevincouto6 Posted April 15, 2018 Author Share Posted April 15, 2018 How do I make the color I want to vehicles? Link to comment
kevincouto6 Posted April 16, 2018 Author Share Posted April 16, 2018 in what line should I add setVehicleColor Link to comment
Verius Posted April 16, 2018 Share Posted April 16, 2018 You should add this here: -- SERVER SIDE SCRIPT!! local vehspawns = { {500,0,0,5,0,0,0,255,40,255, true}, -- example (spawn a freezed vehicle to the farm) -- {vehiclemodelid, posx,posy,posz, rotx,roty,rotz, RED-color, Green-color, Blue-color, freezeonspawn}, } function createVehToSpawn(vehiclemodelid, posx,posy,posz, rotx,roty,rotz,red,green,blue, freezeonspawn) local veh = createVehicle(vehiclemodelid, posx,posy,posz, rotx,roty,rotz) setVehicleColor(veh, red, green, blue) -- color added here -- setElementData(veh, "tablerow", {vehiclemodelid, posx,posy,posz, rotx,roty,rotz,red,green,blue, freezeonspawn}) addEventHandler("onVehicleExplode", veh, respawnVehicle) if freezeonspawn then setElementFrozen(veh, true) addEventHandler("onVehicleEnter", veh, function() setElementFrozen(source, false) end) addEventHandler("onVehicleExit", veh, function() setElementFrozen(source, true) end) end end function respawnVehicle() local v = getElementData(source, "tablerow") if not v then return end if v[11] then removeEventHandler("onVehicleEnter", source, function() setElementFrozen(source, false) end) removeEventHandler("onVehicleExit", source, function() setElementFrozen(source, true) end) end destroyElement(source) createVehToSpawn(v[1], v[2], v[3], v[4], v[5], v[6], v[7], v[8], v[9], v[10], v[11]) -- create back the destroyed vehicle end for i, v in ipairs(vehspawns) do createVehToSpawn(v[1], v[2], v[3], v[4], v[5], v[6], v[7], v[8], v[9], v[10], v[11]) -- spawn vehicles on script start end (It's Patrick2562 code, look up. I only add vehicle colors) Link to comment
kevincouto6 Posted April 18, 2018 Author Share Posted April 18, 2018 -- SERVER SIDE SCRIPT!! local vehspawns = { {461,-2822,194.931640625,5,0,0,90, true}, {461,-2822,191.3056640625,5,0,0,90, true}, {461,-2822,188.06640625,5,0,0,90, true}, {461,-2822,184.8271484375,5,0,0,90, true}, {461,-2822,181.744140625,5,0,0,90, true}, {461,-2822,178.7294921875,5,0,0,90, true}, {461,-2822,175.71484375,5,0,0,90, true}, {461,-2822,172.408203125,5,0,0,90, true}, {468,-2822,142.33984375,5,0,0,90, true}, {468,-2822,138.8955078125,5,0,0,90, true}, {468,-2822,135.29296875,5,0,0,90, true}, {468,-2822,131.9853515625,5,0,0,90, true}, {468,-2822,128.5322265625,5,0,0,90, true}, {468,-2822,124.7802734375,5,0,0,90, true}, {468,-2822,121.3359375,5,0,0,90, true}, {554,-2945.4697265625,191,5,0,0,180, true}, {587,-2951.521484375,191,5,0,0,180, true}, {444,-2957.5947265625,191,5,0,0,180, true}, {603,-2963.5185546875,191,5,0,0,180, true}, {541,-2969.494140625,191,5,0,0,180, true}, {402,-2975.3251953125,191,5,0,0,180, true}, {554,-2945.376953125,123,5,0,0,0, true}, {587,-2951.4091796875,123,5,0,0,0, true}, {444,-2957.3935546875,123,5,0,0,0, true}, {603,-2963.478515625,123,5,0,0,0, true}, {541,-2969.48046875,123,5,0,0,0, true}, {402,-2975.373046875,123,5,0,0,0, true}, {554,-3021.6376953125,189,5,0,0,180, true}, {587,-3027.93359375,189,5,0,0,180, true}, {444,-3033.7587890625,189,5,0,0,180, true}, {603,-3039.7314453125,189,5,0,0,180, true}, {541,-3045.83203125,189,5,0,0,180, true}, {402,-3051.7373046875,189,5,0,0,180, true}, {554,-3021.92578125,123,5,0,0,0, true}, {587,-3028.013671875,123,5,0,0,0, true}, {444,-3033.9326171875,123,5,0,0,0, true}, {603,-3039.998046875,123,5,0,0,0, true}, {541,-3045.97265625,123,5,0,0,0, true}, {402,-3051.9267578125,123,5,0,0,0, true}, {532,-3505.3837890625,157.5322265625,6,0,0,270, true}, {403,-3151.68359375,294,6,0,0,0, true}, {403,-3161.720703125,294,6,0,0,0, true}, {403,-3171.556640625,294,6,0,0,0, true}, {403,-3180.8671875,294,6,0,0,0, true}, {584,-3151.6833496094,283.69784545898,6,0,0,0, true}, {450,-3161.7204589844,284.39559936523,6,0,0,0, true}, {435,-3171.6240234375,284.8740234375,6,0,0,0, true}, {584,-3180.9326171875,285.2646484375,6,0,0,0, true}, {506,-3345.14453125,370,5,0,0,180, true}, {506,-3351,370,5,0,0,180, true}, {506,-3357.1416015625,370,5,0,0,180, true}, {506,-3362.9931640625,370,5,0,0,180, true}, {506,-3368.9833984375,370,5,0,0,180, true}, {506,-3375.1171875,370,5,0,0,180, true}, {446,-3185.3852539063,224.28950500488,0.29879999160767,0,0,269.09796142578, true}, {487,-3267.0419921875,421,8,0,0,0, true}, {487,-3322.505859375,421,8,0,0,0, true}, {487,-3378.42578125,421,8,0,0,0, true}, {487,-3378.1513671875,536,8,0,0,180, true}, {487,-3323.0703125,536,8,0,0,180, true}, {487,-3266.751953125,536,8,0,0,180, true}, {522,-3439,480.3720703125,5,0,0,86.390991210938, true}, {522,-3439,479.0947265625,5,0,0,86.390991210938, true}, {522,-3439,477.78125,5,0,0,86.390991210938, true}, {522,-3439,476.3740234375,5,0,0,86.390991210938, true}, {522,-3439,475.080078125,5,0,0,86.390991210938, true}, {522,-3223,496.34765625,5,0,0,90, true}, {522,-3223,493.7001953125,5,0,0,90, true}, {522,-3223,490.6923828125,5,0,0,90, true}, {522,-3223,488.1201171875,5,0,0,90, true}, {522,-3223,485.435546875,5,0,0,90, true}, {522,-3223,468.8955078125,5,0,0,90, true}, {522,-3223,466.3359375,5,0,0,90, true}, {522,-3223,463.419921875,5,0,0,90, true}, {522,-3223,460.76953125,5,0,0,90, true}, {522,-3223,457.896484375,5,0,0,90, true}, {522,-3202.7587890625,484.42578125,5.5,0,0,0, true}, {522,-3201.8623046875,483.509765625,5.5,0,0,0, true}, {411,-3430.8603515625,462.400390625,5,0,0,270, true}, {411,-3430.9736328125,474.55078125,5,0,0,270, true}, {411,-3430.9404296875,486.7412109375,5,0,0,270, true}, {451,-3430.9296875,493.7060546875,5,0,0,270, true}, {451,-3430.9111328125,481.09375,5,0,0,270, true}, {451,-3430.904296875,468.95703125,5,0,0,270, true}, {411,-3198.498046875,487.21484375,5.5,0,0,318.92761230469, true}, {411,-3203.00390625,491.2578125,5.5,0,0,318.92761230469, true}, {476,-3092.05859375,630.9873046875,6,0,0,70.29052734375, true}, {476,-3109.822265625,606.162109375,6,0,0,37.908325195313, true}, {476,-3140.0625,603.0595703125,6,0,0,339.46105957031, true}, {432,-3074.5009765625,673.88854980469,7,353.681640625,0,90, true}, {432,-3074.5007226563,664.45306396484,7,353.681640625,0,90, true}, {432,-3074.5098339844,655.83953857422,7,353.681640625,0,90, true}, {425,-3199.451171875,633.5693359375,8.5,0,0,0, true}, {425,-3447.9208984375,633.7021484375,8.5,0,0,0, true}, {563,-3261.5546875,634.62109375,8.5,0,0,0, true}, {563,-3386.0087890625,632.8212890625,8.5,0,0,0, true}, {548,-3323.916015625,633.462890625,9.5,0,0,0, true}, } function createVehToSpawn(vehiclemodelid, posx,posy,posz, rotx,roty,rotz, freezeonspawn) local veh = createVehicle(vehiclemodelid, posx,posy,posz, rotx,roty,rotz) setVehicleColor(veh, 253, 140, 29, 253, 140, 29, 253, 140, 29 ,253, 140, 29) setElementData(veh, "tablerow", {vehiclemodelid, posx,posy,posz, rotx,roty,rotz, freezeonspawn}) addEventHandler("onVehicleExplode", veh, respawnVehicle) if freezeonspawn then setElementFrozen(veh, true) addEventHandler("onVehicleEnter", veh, function() setElementFrozen(source, false) end) addEventHandler("onVehicleExit", veh, function() setElementFrozen(source, true) end) end end function respawnVehicle() local v = getElementData(source, "tablerow") if not v then return end if v[8] then removeEventHandler("onVehicleEnter", source, function() setElementFrozen(source, false) end) removeEventHandler("onVehicleExit", source, function() setElementFrozen(source, true) end) end destroyElement(source) createVehToSpawn(v[1], v[2], v[3], v[4], v[5], v[6], v[7], v[8]) -- create back the destroyed vehicle end for i, v in ipairs(vehspawns) do createVehToSpawn(v[1], v[2], v[3], v[4], v[5], v[6], v[7], v[8]) -- spawn vehicles on script start end How to add another command of vehicle respawn? if possible wanted to add /respawnveh, but unchanged when he sees them destroyed? Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now