Jump to content

Help please :D


stefutz101

Recommended Posts

Posted
  
x1=-357.10000610352 
y1=1588.0999755859 
z1=2683 
local x, y, z = getElementPosition(thePlayer)    
function gotoloja(thePlayer)         
        if getElementData(thePlayer, "loja") == false then --check if is in loja 
            setElementPosition(thePlayer, x1, y1, z1) 
            setElementData(thePlayer, "loja", true) -- set true 
        else 
            setElementPosition(thePlayer, x, y ,z) 
            setElementData(thePlayer , "loja", false) -- set false 
        end 
         
end 
addCommandHandler("loja",gotoloja) 
  

This work 50% : this script teleport at x1,y1,z1 but dont it don't teleport back at first x y z ...Please help , Thank You a lot !

Posted

debugscript ?

and try this :

  
x1=-357.10000610352 
y1=1588.0999755859 
z1=2683 
function gotoloja(thePlayer)         
        if getElementData(thePlayer, "loja") == false then --check if is in loja 
        local x, y, z = getElementPosition(thePlayer)    
            setElementPosition(thePlayer, x1, y1, z1) 
            setElementData(thePlayer, "loja", true) -- set true 
        else 
            setElementPosition(thePlayer, x, y ,z) 
            setElementData(thePlayer , "loja", false) -- set false 
        end 
        
end 
addCommandHandler("loja",gotoloja) 
  
Posted
  
x1=-357.10000610352 
y1=1588.0999755859 
z1=2683 
function gotoloja(thePlayer) 
        local x, y, z = getElementPosition(thePlayer) 
        if getElementData(thePlayer, "loja") == false then --check if is in loja 
            setElementPosition(thePlayer, x1, y1, z1) 
            setElementData(thePlayer, "loja", true) -- set true 
        else 
            setElementPosition(thePlayer, x, y ,z) 
            setElementData(thePlayer , "loja", false) -- set false 
        end 
        
end 
addCommandHandler("loja",gotoloja) 
  

Posted

Are you sure you tested it? The code from my post works, unless you have set the script to client side in meta.

Posted

No... I'm telling your script works fine as it should.

x1=-357.10000610352 
y1=1588.0999755859 
z1=2683 
local x, y, z 
function gotoloja(thePlayer) 
        if getElementData(thePlayer, "loja") == false then --check if is in loja 
            x, y, z = getElementPosition(thePlayer) 
            setElementPosition(thePlayer, x1, y1, z1) 
            setElementData(thePlayer, "loja", true) -- set true 
        else 
            setElementPosition(thePlayer, x, y ,z) 
            setElementData(thePlayer , "loja", false) -- set false 
        end 
        
end 
addCommandHandler("loja",gotoloja) 

Posted
x1=-357.10000610352 
y1=1588.0999755859 
z1=2683 
local x, y, z 
function gotoloja(thePlayer) 
    local accountname = getAccountName ( getPlayerAccount ( thePlayer )) 
    if isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "Admin" )) or isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "SuperModerator" )) or isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "Moderator" )) or isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "Helper" )) then   
       if getElementData(thePlayer, "loja") == false then --check if is in loja 
            x, y, z = getElementPosition(thePlayer) 
            setElementPosition(thePlayer, x1, y1, z1) 
            setElementData(thePlayer, "loja", true) -- set true 
        else 
            setElementPosition(thePlayer, x, y ,z) 
            setElementData(thePlayer , "loja", false) -- set false 
        end 
      end  
end 
addCommandHandler("loja",gotoloja) 

If are up to 2 admins / helpers and they go in "loja" when they type /loja again they will be teleport at where was last person when he go in "loja" .

Posted

Of course, because it's global.

x1=-357.10000610352 
y1=1588.0999755859 
z1=2683 
function gotoloja(thePlayer) 
    local accountname = getAccountName ( getPlayerAccount ( thePlayer )) 
    if isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "Admin" )) or isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "SuperModerator" )) or isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "Moderator" )) or isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "Helper" )) then   
       if getElementData(thePlayer, "loja") == false then --check if is in loja 
            setElementPosition(thePlayer, x1, y1, z1) 
            setElementData(thePlayer, "loja", true) -- set true 
            setElementData(thePlayer, "vector", {getElementPosition(thePlayer)}) 
        else 
            local x, y, z = unpack(getElementData(thePlayer, "vector")) 
            setElementPosition(thePlayer, x, y ,z) 
            setElementData(thePlayer , "loja", false) -- set false 
        end 
      end 
end 
addCommandHandler("loja",gotoloja) 

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