KillerNico Posted April 17, 2011 Share Posted April 17, 2011 Hi everybody! I learn scripting in this moment and need help. In a Teleporter i can set the Rotation of the player, right ?? I think its so: function MarkerHit ( hitPlayer, matchingDimension ) if source == inhouse then setElementPosition( hitPlayer, x, y, z ) setPlayerRotation ( x, y, z ) setVehicleFrozen ( true ) setTimer ( setVehicleFrozen, 1000 ) end addEventHandler( "onMarkerHit", inhouse, MarkerHit ) Link to comment
proracer Posted April 17, 2011 Share Posted April 17, 2011 Example: inhouse = createMarker ( 0.0, 0.0, 0.0, 'corona', 2.0, 255, 128, 0, 255 ) -- Change the first 3 parameters to your co-ordinates function MarkerHit ( hitElement ) if ( source ) == inhouse then local x,y,z = getElementPosition ( inhouse ) setElementPosition ( hitElement, x, y + 5, z ) local rotX, rotY, rotZ = getElementRotation ( hitElement ) setElementRotation ( hitElement, rotX, rotY, rotZ + 180 ) end end addEventHandler ( 'onMarkerHit', inhouse, MarkerHit ) Link to comment
KillerNico Posted April 17, 2011 Author Share Posted April 17, 2011 And how to make it so that only Player with Vehicle will teleport >?? Link to comment
Wojak Posted April 17, 2011 Share Posted April 17, 2011 function MarkerHit ( hitPlayer, matchingDimension ) if source == inhouse and getElementType(hitPlayer) == "player" then local veh = getPedOccupiedVehicle(hitPlayer) if isElement(veh) then setElementPosition( veh, x, y, z ) setPlayerRotation (veh, rx, ry, rz ) setVehicleFrozen (veh, true ) setTimer ( setVehicleFrozen, 1000,1,veh,false ) end end addEventHandler( "onMarkerHit", inhouse, MarkerHit ) but this will do everything for you : viewtopic.php?f=108&t=32529 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