iFoReX Posted March 31, 2012 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) elMota/elFoReX De Vuelta En MTA *---------* Cuenta De Youtube En La Que Subo Tutoriales Acerca De MTA :3 https://www.youtube.com/user/KillersGPs
drk Posted March 31, 2012 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 ) EPT Team Server Development: 0% Learning C++ | C++ is amazing
iFoReX Posted March 31, 2012 Author Posted March 31, 2012 thnx draken but I want put a setTimer u can help me ? elMota/elFoReX De Vuelta En MTA *---------* Cuenta De Youtube En La Que Subo Tutoriales Acerca De MTA :3 https://www.youtube.com/user/KillersGPs
drk Posted March 31, 2012 Posted March 31, 2012 In what you want to put a timer? EPT Team Server Development: 0% Learning C++ | C++ is amazing
iFoReX Posted March 31, 2012 Author Posted March 31, 2012 when teleport to the pos elMota/elFoReX De Vuelta En MTA *---------* Cuenta De Youtube En La Que Subo Tutoriales Acerca De MTA :3 https://www.youtube.com/user/KillersGPs
drk Posted March 31, 2012 Posted March 31, 2012 But what the timer will do?? EPT Team Server Development: 0% Learning C++ | C++ is amazing
sckatchof Posted March 31, 2012 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 )
iFoReX Posted March 31, 2012 Author 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 ? elMota/elFoReX De Vuelta En MTA *---------* Cuenta De Youtube En La Que Subo Tutoriales Acerca De MTA :3 https://www.youtube.com/user/KillersGPs
sckatchof Posted March 31, 2012 Posted March 31, 2012 you mean only you account name can enter to the marker ?
iFoReX Posted March 31, 2012 Author Posted March 31, 2012 dont, only my account name can teleport in the market elMota/elFoReX De Vuelta En MTA *---------* Cuenta De Youtube En La Que Subo Tutoriales Acerca De MTA :3 https://www.youtube.com/user/KillersGPs
sckatchof Posted March 31, 2012 Posted March 31, 2012 dont, only my account name can teleport in the market use this local name = getPlayerName(player) if name == "YourName" then
drk Posted March 31, 2012 Posted March 31, 2012 He want the account name, not the player name. EPT Team Server Development: 0% Learning C++ | C++ is amazing
Kenix Posted March 31, 2012 Posted March 31, 2012 ElMota, Learn https://wiki.multitheftauto.com/wiki/Scr ... troduction You said me you learn .. http://vk.com/the_kenix Вопросы задавайте на форуме, не пишите мне в личку. Please don't pm me.
iFoReX Posted March 31, 2012 Author 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 ) elMota/elFoReX De Vuelta En MTA *---------* Cuenta De Youtube En La Que Subo Tutoriales Acerca De MTA :3 https://www.youtube.com/user/KillersGPs
sckatchof Posted March 31, 2012 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 )
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