Nov 24, 2024, 00:14:15
Ownage Owls

Poll

have you been?

Yes
No

Author Topic: Teleport Maker  (Read 15067 times)

Feb 27, 2011, 14:25:08
Read 15067 times
Offline

Dangerr


Teleport With Marker

------------------------------------------------------------------------------------------------
local root = getRootElement()
local this = getThisResource()
local resourceRoot = getResourceRootElement(this)
local localPlayer = getLocalPlayer()
local Marker = {}


addEventHandler("onClientResourceStart", resourceRoot,
function()
Marker[1] = createMarker(X, Y, Z, "corona", 10, 0, 0, 0)
Marker[2] = createMarker(X, Y, Z, "corona", 10, 0, 0, 0)
Marker[3] = createMarker(X, Y, Z, "corona", 10, 0, 0, 0)
Marker[4] = createMarker(X, Y, Z, "corona", 10, 0, 0, 0)
Marker[5] = createMarker(X, Y, Z, "corona", 10, 0, 0, 0)
Marker[6] = createMarker(X, Y, Z, "corona", 10, 0, 0, 0)
Marker[7] = createMarker(X, Y, Z, "corona", 10, 0, 0, 0)
Marker[8] = createMarker(X, Y, Z, "corona", 10, 0, 0, 0)
Marker[9] = createMarker(X, Y, Z, "corona", 10, 0, 0, 0)

Marker example Marker[1] = createMarker(4455.2, -778.9, 60.9, "corona", 10, 0, 0, 0)
>coordinate x y z inizial teleport<
end
)

addEventHandler("onClientResourceStop", root,
function(res)
if res == this then






end
end
)

addEventHandler("onClientMarkerHit", root,
function(player, matchingDimension)
if not matchingDimension then return end

if player == localPlayer and isPedInVehicle(player) then
local vehicle = getPedOccupiedVehicle(player)


if source == Marker[1] then


setElementPosition (vehicle , 4822.8, -1442, 5.3 ) this is x y z teleport arrival
setElementRotation(vehicle ,0,0,0)  
setVehicleFrozen ( vehicle , true )
setTimer( setVehicleFrozen, 1000, 1, vehicle, false ) frozen vehicle arrival 1000 is 1 sec. freeze



elseif source == Marker[2] then


elseif source == Marker[3] then


elseif source == Marker[4] then

elseif source == Marker[5] then


elseif source == Marker[6] then

elseif source == Marker[7] then

elseif source == Marker[8] then


elseif source == Marker[9] then

end
end
end
)
------------------------------------------------------
for other info posted here

or posted inzial teleport x y z and arrival x y z

good look!!!!!!! :) by Danger
Anonymous.

Feb 27, 2011, 14:29:06
Reply #1

Slipknot

Guest
wtf is this

Feb 27, 2011, 14:37:20
Reply #2
Offline

Dangerr


for maps if you want to move to another site, you have to put it on the client ^^
Anonymous.

Feb 27, 2011, 14:41:16
Reply #3
Offline

Millhouse

Member
you are making it complicate
best way to show someone something is an example

Code: [Select]
marker1 = createMarker( 7571.6472167969, 1114.9816894531, 14, "corona", 2.3, 0, 144, 255, 255)


function teleport (player)
   if source == marker1 then
      if isPedInVehicle(player) then
         local vehicle=getPedOccupiedVehicle(player)
         setElementPosition(vehicle, 7571.6472167969, 999.71392822266, 15.8)
         setVehicleFrozen(vehicle, false)
         setTimer(setVehicleFrozen, 1000, 1, vehicle, false)
         setElementRotation ( vehicle, 0, 0, 0 )
         setElementVelocity ( vehicle, -0.5, 0, 0)
      end
   end
end

addEventHandler("onClientMarkerHit", getRootElement(), teleport)

this is one teleport marker, if you need more just add

Code: [Select]
marker2 = createMarker( 7571.6472167969, 1114.9816894531, 14, "corona", 2.3, 0, 144, 255, 255)
the rest is same. ofcorse, you can replece corona with checkpint or circle,  2.3 is size, 0,144,255 is color, and last digit 255 is alpha (transparency)


CODE EXPLANATION:


Code: [Select]
setElementPosition(vehicle, 7571.6472167969, 999.71392822266, 15.8)this is place where you gonna teleport to, XYZ....

Code: [Select]
setElementRotation ( vehicle, 0, 0, 0 )when you jump into teleport marker you have to set rotation of vehicle at "new spawn point", ofcorse everything is XYZ...

Code: [Select]
setElementVelocity ( vehicle, 0.5, 0, 0)at new spawn point you can set here if your car will spawn at 0 speed or moving, XYZ)

Code: [Select]
  setVehicleFrozen(vehicle, false)
         setTimer(setVehicleFrozen, 1000, 1, vehicle, false)
Replace False with True and set time how long the car will be frozen at spawn...

« Last Edit: Feb 27, 2011, 14:51:25 by Millhouse »

Feb 27, 2011, 15:14:16
Reply #4
Offline

Dangerr


like you've put this much better explained ^^
Anonymous.