iFoReX Posted March 31, 2012 Share Posted March 31, 2012 I created a market and work but when Im inside of market I dont teleport here my code .lua local x = 685.62610 local y = -2692.39307 local z = 7.5 local market = createMarker ( x, y, z, "cylinder", 1.5, 0, 0, 255, 170 ) function markerHit (hitPlayer) if ( hitPlayer == localPlayer ) then setElementPosition(0,0,0) end end addEventHandler ("onClientMarkerHit", market, markerHit) Link to comment
drk Posted March 31, 2012 Share Posted March 31, 2012 local x = 685.62610 local y = -2692.39307 local z = 7.5 local market = createMarker ( x, y, z, "cylinder", 1.5, 0, 0, 255, 170 ) addEventHandler ( 'onClientMarkerHit', root, function ( player ) if ( player == localPlayer and source == market ) then setElementPosition ( player, 0, 0, 0 ); end end ) Link to comment
iFoReX Posted March 31, 2012 Author Share Posted March 31, 2012 thnx draken but I want put a setTimer u can help me ? Link to comment
drk Posted March 31, 2012 Share Posted March 31, 2012 In what you want to put a timer? Link to comment
iFoReX Posted March 31, 2012 Author Share Posted March 31, 2012 when teleport to the pos Link to comment
sckatchof Posted March 31, 2012 Share Posted March 31, 2012 try this local x = 685.62610 local y = -2692.39307 local z = 7.5 local market = createMarker ( x, y, z, "cylinder", 1.5, 0, 0, 255, 170 ) addEventHandler ( 'onClientMarkerHit', root, function ( player ) if ( player == localPlayer and source == market ) then setTimer(setElementPosition, 1000, 1, player, 0, 0, 0 ); --- After 1 second end end ) Link to comment
iFoReX Posted March 31, 2012 Author Share Posted March 31, 2012 thnx mans It work now This is my script .lua local x = 685.62610 local y = -2692.39307 local z = 7.5 local x2 = 294.38306 local y2 = -167.90103 local z2 = 1.57813 local market = createMarker ( x, y, z, "cylinder", 1.5, 0, 0, 255, 170 ) local market2 = createMarker ( x2 + 2, y2, z2 - 1, "cylinder", 1.5, 0, 0, 255, 170 ) addEventHandler ( 'onClientMarkerHit', root, function ( player ) if ( player == localPlayer and source == market ) then setTimer(setElementPosition, 2000, 1, player, x2, y2, z2 ); elseif ( player == localPlayer and source == market2 ) then setTimer(setElementPosition, 2000, 1, player, x + 2, y + 2, z + 2 ); end end ) But , can help me with this ? I want only my name can teleport in 1 market , can help me please ? Link to comment
sckatchof Posted March 31, 2012 Share Posted March 31, 2012 you mean only you account name can enter to the marker ? Link to comment
iFoReX Posted March 31, 2012 Author Share Posted March 31, 2012 dont, only my account name can teleport in the market Link to comment
sckatchof Posted March 31, 2012 Share Posted March 31, 2012 dont, only my account name can teleport in the market use this local name = getPlayerName(player) if name == "YourName" then Link to comment
drk Posted March 31, 2012 Share Posted March 31, 2012 He want the account name, not the player name. Link to comment
Kenix Posted March 31, 2012 Share Posted March 31, 2012 ElMota, Learn https://wiki.multitheftauto.com/wiki/Scr ... troduction You said me you learn .. Link to comment
iFoReX Posted March 31, 2012 Author Share Posted March 31, 2012 what is bad ? local x = 685.62610 local y = -2692.39307 local z = 7.5 local x2 = 294.38306 local y2 = -167.90103 local z2 = 1.57813 local market = createMarker ( x, y, z, "cylinder", 1.5, 0, 0, 255, 170 ) local market2 = createMarker ( x2 + 2, y2, z2 - 1, "cylinder", 1.5, 0, 0, 255, 170 ) addEventHandler ( 'onClientMarkerHit', root, function ( player ) local name = getPlayerName(player) if name == "ElMota" then if ( player == localPlayer and source == market ) then setTimer(setElementPosition, 2000, 1, player, x2, y2, z2 ); elseif ( player == localPlayer and source == market2 ) then setTimer(setElementPosition, 2000, 1, player, x + 2, y + 2, z + 2 ); end end ) Link to comment
sckatchof Posted March 31, 2012 Share Posted March 31, 2012 ty this : local x = 685.62610 local y = -2692.39307 local z = 7.5 local x2 = 294.38306 local y2 = -167.90103 local z2 = 1.57813 local market = createMarker ( x, y, z, "cylinder", 1.5, 0, 0, 255, 170 ) local market2 = createMarker ( x2 + 2, y2, z2 - 1, "cylinder", 1.5, 0, 0, 255, 170 ) addEventHandler ( 'onClientMarkerHit', root, function ( player ) local name = getPlayerName(player) if name == "ElMota" then if ( player == localPlayer and source == market ) then setTimer(setElementPosition, 2000, 1, player, x2, y2, z2 ); elseif ( player == localPlayer and source == market2 ) then setTimer(setElementPosition, 2000, 1, player, x + 2, y + 2, z + 2 ); end end end ) 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