Michael_Tuner Posted March 25, 2010 Share Posted March 25, 2010 (edited) In an earlier post of mine it said that if you make a script and add it to play resource it will play the resource. But when I start this resource the car doesn't appear. boxwille = createVehicle ( 495, 1226.8956298828, -987.04681396484, 43.686561584473, 0, 0, 87.609985351563 ) -- create us a new vehicle if ( boxwille ) then setVehicleRespawnDelay ( newvehicle, 900000 ) -- tell the server to respawn the vehicle 15 minutes after it's blown end sanchez1 = createVehicle ( 1222.3643798828, -982.44836425781, 43.686561584473, 0, 0, 87.609985351563 ) if ( sanchez1 ) then setVehicleRespawnDelay ( newvehicle, 900000 ) -- tell the server to respawn the vehicle 15 minutes after it's blown end sanchez2 = createVehicle ( 1222.3643798828, -991.80096435547, 43.686561584473, 0, 0, 87.609985351563 ) if ( sanchez1 ) then setVehicleRespawnDelay ( newvehicle, 900000 ) -- tell the server to respawn the vehicle 15 minutes after it's blown end function chatbox ( onVehicleRespawn ) onVehicleRespawn ( boxwille ) outputChatBox ( "The Boxwille has arrived, Visit temple area and you will see" [255,0,0] ) end function followblip () createBlipAttachedTo ( boxwille, 51 ) end function playsound() onVehicleEnter (boxwille) then outputChatBox ( "#FF0000*"..getPlayerName.. "has Entered the truck" ) outputChatBox ( "#FF0000* Get the truck to the destination" ..getPlayerName.., source) onVehicleExit ( boxwille ) then outputChatBox ( "#FF0000*"..getPlayerName.." has left the truck" ) outputChatBox ( "#FF0000*Get back on the truck" ..getPlayerName..", source" ) end Edited March 25, 2010 by Guest Link to comment
Xierra Posted March 25, 2010 Share Posted March 25, 2010 First, you'll see this: boxwille = createVehicle ( 495, 1226.8956298828, -987.04681396484, 43.686561584473, 0, 0, 87.609985351563 ) -- create us a new vehicle if ( boxwille ) then setVehicleRespawnDelay ( newvehicle, 900000 ) -- tell the server to respawn the vehicle 15 minutes after it's blown end sanchez1 = createVehicle ( 1222.3643798828, -982.44836425781, 43.686561584473, 0, 0, 87.609985351563 ) if ( sanchez1 ) then setVehicleRespawnDelay ( newvehicle, 900000 ) -- tell the server to respawn the vehicle 15 minutes after it's blown end sanchez2 = createVehicle ( 1222.3643798828, -991.80096435547, 43.686561584473, 0, 0, 87.609985351563 ) if ( sanchez1 ) then setVehicleRespawnDelay ( newvehicle, 900000 ) -- tell the server to respawn the vehicle 15 minutes after it's blown end A bit messed up! Check line 6 and 10. And you forgot to put the vehicle ID on line 5 and 9! and also the argument for setVehicleRespawnDelay is wrong. I guess you forgot to add the function. So the result must be: function vehicles() boxwille = createVehicle ( 495, 1226.8956298828, -987.04681396484, 43.686561584473, 0, 0, 87.609985351563 ) -- create us a new vehicle if ( boxwille ) then setVehicleRespawnDelay ( boxwille, 900000 ) -- tell the server to respawn the vehicle 15 minutes after it's blown sanchez1 = createVehicle ( 468, 1222.3643798828, -982.44836425781, 43.686561584473, 0, 0, 87.609985351563 ) if ( sanchez1 ) then setVehicleRespawnDelay ( sanchez1, 900000 ) -- tell the server to respawn the vehicle 15 minutes after it's blown sanchez2 = createVehicle ( 468, 1222.3643798828, -991.80096435547, 43.686561584473, 0, 0, 87.609985351563 ) if ( sanchez2 ) then setVehicleRespawnDelay ( sanchez2, 900000 ) -- tell the server to respawn the vehicle 15 minutes after it's blown end end end It's not tested yet so test it. I also didn't see any event handlers. Why not put a event handler to start it , like: addEventHandler( "onClientResourceStart", getRootElement( ),>function name< Link to comment
karlis Posted March 25, 2010 Share Posted March 25, 2010 setvehiclerespawndelay is not what u need as it wont respawn if some1 is in stream range Link to comment
Michael_Tuner Posted March 25, 2010 Author Share Posted March 25, 2010 I just want to respawn it if it is left emptied it just 8sec. And wouldn't it feel better in Server-side? Thx Very much XX3 & Karlis Link to comment
karlis Posted March 25, 2010 Share Posted March 25, 2010 if you want to respawn vehicles after leaving, not streaming out try this: --serverside addEventHandler("onVehicleExit",boxwille,function(_,seat) if seat==0 then respawntimer=setTimer(function() respawnVehicle(boxwille) end,8000,1) --time in miliseconds end end) addEventHandler("onVehicleEnter",boxwille,function() if isTimer(respawntimer) then killTimer(respawntimer) end end) im not sure, will it work, but you can try Link to comment
Michael_Tuner Posted March 25, 2010 Author Share Posted March 25, 2010 I want it to disappear in 8sec not respawn in 8sec and I want to respawn it in only 15min. I think what I made doesn't fit for dissapearing part but respawn, Ok? I think. Link to comment
Xierra Posted March 25, 2010 Share Posted March 25, 2010 maybe you can make it move to another dimension, then go back to 0 and respawn? 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