TuRisMo Posted March 4, 2012 Share Posted March 4, 2012 This is the code i made for teleport marker = createMarker(934, -1452, 14.5, "arrow", 1.5, 230, 251, 3, 153) function teleport(player) if getElementType(player)=="player" then local vehicle=getPedOccupiedVehicle(player) if source == marker then setElementPosition(player, -354.3, -3786.8000976563, 16.40000038147) setElementFrozen(player, false) setTimer(setElementFrozen, 1000, 1, player, false) end end end addEventHandler("onClientMarkerHit", getRootElement(), teleport) how to make two different markers cuz when i make coppy to this code and paste again and change locations, id doesn't work plz give me the right code and Thx Link to comment
bandi94 Posted March 4, 2012 Share Posted March 4, 2012 server side marker1 = createMarker(934, -1452, 14.5, "arrow", 1.5, 230, 251, 3, 153) function teleport1(player) if getElementType(player)=="player" then local vehicle=getPedOccupiedVehicle(player) setElementPosition(player, -354.3, -3786.8000976563, 16.40000038147) setElementFrozen(player, false) setTimer(setElementFrozen, 1000, 1, player, false) end end addEventHandler("onMarkerHit", marker1, teleport1) marker2 = createMarker(934, -1452, 14.5, "arrow", 1.5, 230, 251, 3, 153) function teleport2(player) if getElementType(player)=="player" then local vehicle=getPedOccupiedVehicle(player) setElementPosition(player, -354.3, -3786.8000976563, 16.40000038147) setElementFrozen(player, false) setTimer(setElementFrozen, 1000, 1, player, false) end end addEventHandler("onMarkerHit", marker2, teleport2) Link to comment
TuRisMo Posted March 4, 2012 Author Share Posted March 4, 2012 not working plz help me Link to comment
Evil-Cod3r Posted March 4, 2012 Share Posted March 4, 2012 marker1 = createMarker(934, -1452, 14.5, "arrow", 1.5, 230, 251, 3, 153) function Hit1 ( hitElement, matchingDimension ) local Type = getElementType( hitElement ) local vehicle=getPedOccupiedVehicle(source) setElementPosition(Type, -354.3, -3786.8000976563, 16.40000038147) setElementFrozen(Type, false) setTimer(setElementFrozen, 1000, 1, Type, false) end end end addEventHandler("onMarkerHit", marker1, Hit1) marker2 = createMarker(934, -1452, 14.5, "arrow", 1.5, 230, 251, 3, 153) function Hit2 ( hitElement, matchingDimension ) local Type = getElementType( hitElement ) local vehicle=getPedOccupiedVehicle(source) setElementPosition(Type, -354.3, -3786.8000976563, 16.40000038147) setElementFrozen(Type, false) setTimer(setElementFrozen, 1000, 1, Type, false) end end addEventHandler("onMarkerHit", marker2, Hit2) Link to comment
Castillo Posted March 4, 2012 Share Posted March 4, 2012 marker1 = createMarker(934, -1452, 14.5, "arrow", 1.5, 230, 251, 3, 153) marker2 = createMarker(934, -1452, 14.5, "arrow", 1.5, 230, 251, 3, 153) function teleport(player) if (source == marker1 and getElementType(player) == "player") then setElementPosition(player, -354.3, -3786.8000976563, 16.40000038147) setElementFrozen(player, false) setTimer(setElementFrozen, 1000, 1, player, false) elseif (source == marker2 and getElementType(player) == "player") then setElementPosition(player, -354.3, -3786.8000976563, 16.40000038147) setElementFrozen(player, false) setTimer(setElementFrozen, 1000, 1, player, false) end end addEventHandler("onMarkerHit", root, teleport) @Evil: You're trying to set position of a string? nice one. Link to comment
Evil-Cod3r Posted March 4, 2012 Share Posted March 4, 2012 lol i didnt know ok now i get it Link to comment
TuRisMo Posted March 4, 2012 Author Share Posted March 4, 2012 Wow thx both of you it works now 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