A_TERMINATOR Posted March 26, 2012 Share Posted March 26, 2012 Hi, I found bug, I have code: function teleportEnd() teleporting = 0 fadeCamera(true) local localPlayer = getLocalPlayer() if (setElementPosition(localPlayer, 0.0, 0.0, 10.0) == true) then outputChatBox("Teleported succesfully") else outputChatBox("Not Teleported!") end teleported = 1 outputChatBox("Teleported!") end client-side And everything is working, but setElementPosition is not working! I have message "Teleported succesfully" and "Teleported!" on the chat. But my position doesn't change! Everything is ok, please help me. Link to comment
Castillo Posted March 26, 2012 Share Posted March 26, 2012 Try making the script server side instead. Link to comment
Kenix Posted March 26, 2012 Share Posted March 26, 2012 It should work i think you use it on server side. Show meta.xml Also use [xml][/xml] tags. Link to comment
Vision Posted March 26, 2012 Share Posted March 26, 2012 function teleportEnd() teleporting = 0 fadeCamera(true) local localPlayer = getLocalPlayer() if ( setElementPosition ( localPlayer, 0.0, 0.0, 10.0, true ) ) then outputChatBox("Teleported succesfully") else outputChatBox("Not Teleported!") end teleported = 1 outputChatBox("Teleported!") end Link to comment
A_TERMINATOR Posted March 26, 2012 Author Share Posted March 26, 2012 On server-side still not working! code: (client-side) function teleportEnd() teleportuje = 0 fadeCamera(true) triggerServerEvent("playerTeleport", getLocalPlayer()) teleported = 1 outputChatBox("Teleportowano!") end code: (server-side) function teleportPlayer() setElementPosition(source, 0.0, 0.0, 10.0) outputChatBox("Teleported!", source) end addEvent("playerTeleport", true) addEventHandler("playerTeleport", getRootElement(), teleportPlayer) meta.xml: <meta> <info author="Radek" type="script" name="Woda-Kolor" /> <min_mta_version client="1.3.0" server="1.3.0" /> <file src="/sounds/hell.mp3" /> <file src="/sounds/thunder1.mp3" /> <file src="/sounds/thunder2.mp3" /> <file src="/sounds/thunder_and_wind.mp3" /> <file src="/sounds/Duch.mp3" /> <file src="/sounds/dziwne.mp3" /> <file src="/sounds/Frankenstein.mp3" /> <file src="/sounds/glos.mp3" /> <file src="/sounds/naczynia.mp3" /> <file src="/sounds/noc1.mp3" /> <file src="/sounds/noc2.mp3" /> <file src="/sounds/Policja.mp3" /> <file src="/sounds/smiech1.mp3" /> <file src="/sounds/smiech2.mp3" /> <file src="/sounds/smiech3.mp3" /> <file src="/sounds/Ufo.mp3" /> <file src="/sounds/bron/shotgun.mp3" /> <file src="/sounds/bron/wystrzal.wav" /> <file src="/sounds/bron/colt.wav" /> <file src="/models/tractor.txd" /> <file src="/models/tractor.dff" /> <file src="/pictures/wasted.jpg" /> <file src="/pictures/kluczyki.jpg" /> <file src="/pictures/smieci.jpg" /> <file src="/pictures/szukam.jpg" /> <script src="moje-client.lua" type="client" /> <script src="moje.lua" type="server" /> </meta> Also I use official zombie mode. HELP! Link to comment
Castillo Posted March 26, 2012 Share Posted March 26, 2012 Your original code works perfectly fine, I get warped to position: 0, 0, 10. Link to comment
A_TERMINATOR Posted March 26, 2012 Author Share Posted March 26, 2012 Ok, finally works. I must removed player from vehicle before teleporting 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