naz19 Posted April 1, 2012 Share Posted April 1, 2012 addEventHandler('onResourceStart',root, function() ped = createPed(252,-158,584,15) veh = createVehicle(515,-158,584,16,0,0,284) setTimer(function() warpPedIntoVehicle (ped, veh,0) end,1000,1) if (veh) then setTimer( function() setElementVelocity(veh,0.5,0,0) end ,5000,1) end marker = createMarker(-35,613,11,"ring",3) addEventHandler('onMarkerHit',root, function(hitElement, matchingDimension) if source == marker then if hitElement == veh then setTimer( function() setElementRotation(veh,0,90,30) ------------------------ don't rotate! end ,1000,1) end end end ) end ) HELP ME!!!!!!!!!!! debugscript (3) says nothing x( Link to comment
Kenix Posted April 1, 2012 Share Posted April 1, 2012 Try Server addEventHandler( 'onResourceStart', root, function( ) uPed = createPed( 252, -158, 584, 15) uVehicle = createVehicle( 515, -158, 584, 16, 0, 0, 284 ) setTimer( function( uVehicle ) warpPedIntoVehicle ( uPed, uVehicle ) end, 1000, 1, uVehicle ) if uVehicle then setTimer( function( uVehicle ) setElementVelocity( uVehicle, 0.5, 0, 0 ) end, 5000, 1, uVehicle ) end uMarker = createMarker( -35, 613, 11, "ring", 3 ) addEventHandler( 'onMarkerHit', root, function( uHitElement, bDim ) if source == uMarker then if getElementType( uHitElement ) == 'player' and isPedInVehicle( uHitElement ) then setTimer( function( uHitElement ) setElementRotation( getPedOccupiedVehicle( uHitElement ) or uHitElement, 0, 90, 30 ) ------------------------ don't rotate! end, 1000, 1, uHitElement ) end end end ) end ) Link to comment
naz19 Posted April 1, 2012 Author Share Posted April 1, 2012 TryServer addEventHandler( 'onResourceStart', root, function( ) uPed = createPed( 252, -158, 584, 15) uVehicle = createVehicle( 515, -158, 584, 16, 0, 0, 284 ) setTimer( function( uVehicle ) warpPedIntoVehicle ( uPed, uVehicle ) end, 1000, 1, uVehicle ) if uVehicle then setTimer( function( uVehicle ) setElementVelocity( uVehicle, 0.5, 0, 0 ) end, 5000, 1, uVehicle ) end uMarker = createMarker( -35, 613, 11, "ring", 3 ) addEventHandler( 'onMarkerHit', root, function( uHitElement, bDim ) if source == uMarker then if getElementType( uHitElement ) == 'player' and isPedInVehicle( uHitElement ) then setTimer( function( uHitElement ) setElementRotation( getPedOccupiedVehicle( uHitElement ) or uHitElement, 0, 90, 30 ) ------------------------ don't rotate! end, 1000, 1, uHitElement ) end end end ) end ) don't work x( Link to comment
naz19 Posted April 1, 2012 Author Share Posted April 1, 2012 <meta> name="lol" type="script" author="Naz" version="1.0" description="smth"></info> <script src="smth.lua"></script> </meta> Edit: type of script is not specified = type='server' Link to comment
Kenix Posted April 1, 2012 Share Posted April 1, 2012 Your meta.xml WRONG. <meta> <info name="lol" type="script" author="Naz" version="1.0" description="smth" /> <script src="smth.lua" /> </meta> Also use my meta.xml generator viewtopic.php?f=108&t=41111 P.S Also read it https://wiki.multitheftauto.com/wiki/Meta.xml Link to comment
naz19 Posted April 1, 2012 Author Share Posted April 1, 2012 but.....script works car creates, ped too, everything works without rotating i don't think that problem is with meta P.S.:meta error is because bad copy/paste Link to comment
Kenix Posted April 1, 2012 Share Posted April 1, 2012 Check all conditions, variables, ... Link to comment
naz19 Posted April 1, 2012 Author Share Posted April 1, 2012 the most worst is that i can't see any error x( idea of my code (as you see) is to create car that will move without anyone (controlled by script), i tryed use markers for this, but as i can't see error and it's don't work, i must ask have you any another idea how to make it? Link to comment
Kenix Posted April 1, 2012 Share Posted April 1, 2012 Create vehicle. Create ped. Warp ped to vehicle. Trigger to client. setPedControlState And use argument 'accelerate'. 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