Jump to content

Help with a code D:


novo

Recommended Posts

Hi all.

I don't know why this function, isn't working:

  
function bind(source) 
local accountname = getAccountName(account) 
if (isObjectInACLGroup("user." ..accountname, aclGetGroup("Admin"))) or (isObjectInACLGroup("user." ..accountname, aclGetGroup("VIP"))) then 
    if (guiGetVisible(iphone) == true) then 
        if not animacion then 
            cerrar(localPlayer) 
        end 
    else 
        if not animacion then 
            guiSetVisible(iphone, true) 
            setElementData (localPlayer,"panel","main") 
            addEventHandler ("onClientRender", root, sacarSXPhone) 
        end 
    end 
end 
end 
bindKey("I","down", bind) 
addCommandHandler ("iphone", bind) 
addEventHandler ("onPlayerLogin", root, bind) 
  

Plz help <3

Link to comment

Messy.

Are you sure that's the full code? If not:

- There is no function for 'cerrar' or 'animacion'.

- You haven't defined animacion

Problems:

- You are using the script in client-side, this is a server-side stuff

function bind() 
    local accountname = getAccountName(getPlayerAccount(source)) 
    if isObjectInACLGroup("user." .. accountname, aclGetGroup("Admin")) or  
    isObjectInACLGroup("user." .. accountname, aclGetGroup("VIP")) then 
  
    if guiGetVisible(iphone) == true then 
        if not animacion then 
            cerrar(localPlayer) 
        end 
    else 
        if animacion then 
            guiSetVisible(iphone, true) 
            setElementData(localPlayer, "panel", "main") 
            addEventHandler("onClientRender", getRootElement(), sacarSXPhone) 
        end 
    end 
end 
addCommandHandler("iphone", bind) 
addEventHandler("onPlayerLogin", getRootElement(), bind) 
  
function bindme() 
    for i,v in ipairs(getElementsByType("player")) do 
        bindKey(v, "I", "down", bind) 
    end 
end 
addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), bindme) 

Edited by Guest
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...