Jump to content

setElementPosition not working!


Recommended Posts

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
  
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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...