Paranoia Posted July 15, 2014 Share Posted July 15, 2014 Hi, ive been encountering problems whenever i want to spawn a vehicle when i step on a marker and i was wondering why my cylinder marker is always floating whenever i script markers into that area, Here's the code ) P.S Im a newbie scripter marker = createMarker(2088.07031, -1629.89954, 13.54688, "cylinder", 1.7, 0, 0, 255) function spawnVehicleForPlayer(thePlayer) if ( source == marker ) then vehicle = createdVehicle(468, getElementPosition(thePlayer)) warpPedIntoVehicle (thePlayer, createdVehicle) end end addEventHandler("onMarkerHit", root, spawnVehicleForPlayer) Link to comment
Max+ Posted July 15, 2014 Share Posted July 15, 2014 (edited) marker = createMarker(2088.07031, -1629.89954, 13.54688, "cylinder", 1.7, 0, 0, 255) addEventHandler("onMarkerHit", marker, function ( ) local nx, ny, nz = getElementPosition ( source ) vehicle = createVehicle(468,nx, ny, nz ) warpPedIntoVehicle ( source, vehicle ) outputChatBox (' * your in the vehicle Now, Drive *', source, 255, 255, 0 ) end ) Edited July 15, 2014 by Guest Link to comment
Moderators !#NssoR_) Posted July 15, 2014 Moderators Share Posted July 15, 2014 marker = createMarker(2088.07031, -1629.89954, 13.54688, "cylinder", 1.7, 0, 0, 255) addEventHandler("onMarkerHit", marker, function ( ) local nx, ny, nz = getElementPosition ( source) vehicle = createdVehicle(468,nx, ny, nz ) warpPedIntoVehicle ( source, vehicle ) outputChatBox (' * your in the vehicle Now, Drive *', source, 255, 255, 0 ) end ) Line 5 createdVehicle = X source = The source of this event is the marker that got hit by the element. marker = createMarker(2088.07031, -1629.89954, 13.54688, "cylinder", 1.7, 0, 0, 255) addEventHandler("onMarkerHit", marker, function ( player ) local nx, ny, nz = getElementPosition ( player ) vehicle = createVehicle(468,nx, ny, nz ) warpPedIntoVehicle ( player , vehicle ) outputChatBox (' * your in the vehicle Now, Drive *', player , 255, 255, 0 ) end ) Link to comment
Arnold-1 Posted July 15, 2014 Share Posted July 15, 2014 Max doesn't want to stop helping people in a wrong way for sorry, i would suggest removing his content creation right for some weeks. Link to comment
Paranoia Posted July 15, 2014 Author Share Posted July 15, 2014 marker = createMarker(2088.07031, -1629.89954, 13.54688, "cylinder", 1.7, 0, 0, 255) addEventHandler("onMarkerHit", marker, function ( ) local nx, ny, nz = getElementPosition ( source) vehicle = createdVehicle(468,nx, ny, nz ) warpPedIntoVehicle ( source, vehicle ) outputChatBox (' * your in the vehicle Now, Drive *', source, 255, 255, 0 ) end ) Line 5 createdVehicle = X source = The source of this event is the marker that got hit by the element. marker = createMarker(2088.07031, -1629.89954, 13.54688, "cylinder", 1.7, 0, 0, 255) addEventHandler("onMarkerHit", marker, function ( player ) local nx, ny, nz = getElementPosition ( player ) vehicle = createVehicle(468,nx, ny, nz ) warpPedIntoVehicle ( player , vehicle ) outputChatBox (' * your in the vehicle Now, Drive *', player , 255, 255, 0 ) end ) Btw how to fix my cylinder always floating everytime i script it Thanks in advance Link to comment
Arnold-1 Posted July 15, 2014 Share Posted July 15, 2014 floating everytime you script it? what do you mean? Link to comment
Paranoia Posted July 15, 2014 Author Share Posted July 15, 2014 Like, i want my cylinder to be on the ground but its in the air, floating Link to comment
Max+ Posted July 15, 2014 Share Posted July 15, 2014 (edited) Max doesn't want to stop helping people in a wrong way for sorry, i would suggest removing his content creation right for some weeks. and are you the owner of the website ? [ i dont think so ] also i'm sure my code will work just forgot to fix the createVehicle remove the d , Edited July 15, 2014 by Guest Link to comment
Max+ Posted July 15, 2014 Share Posted July 15, 2014 Like, i want my cylinder to be on the ground but its in the air, floating Change the 1.7 to 1.0 marker = createMarker(2088.07031, -1629.89954, 13.54688, "cylinder", 1.0, 0, 0, 255) Link to comment
TAPL Posted July 15, 2014 Share Posted July 15, 2014 Max doesn't want to stop helping in a wrong way for sorry, i would suggest removing his content creation right for some weeks. and are you the owner of the website ? [ i dont think so ] also i sure my code will work just forgot to fix the createVehicle remove the d , oh yeah warp the marker into the vehicle and output to the marker, perfect. Link to comment
Paranoia Posted July 15, 2014 Author Share Posted July 15, 2014 the marker is still in the air, i restarted the resource and another problem, why is it double/triple/quadratic spawning every sanchez hits the marker it spawns Link to comment
Sande Posted July 15, 2014 Share Posted July 15, 2014 Just put the Z-coordinate lower and then it´s on the ground. Link to comment
Arnold-1 Posted July 15, 2014 Share Posted July 15, 2014 Max doesn't want to stop helping in a wrong way for sorry, i would suggest removing his content creation right for some weeks. and are you the owner of the website ? [ i dont think so ] also i sure my code will work just forgot to fix the createVehicle remove the d , oh yeah warp the marker into the vehicle and output to the marker, perfect. Exactly what i wanted to say 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