Jump to content

getAccountName problem [Solved]


Miika

Recommended Posts

Server does not outpt chatbox and Nikotuz can't open garage. And debugscript does not say anything.

What is the problem?

[server]

function garage1() 
if (getAccountName == "Nikotuz") then 
    if (not isGarageOpen(20)) then 
        setGarageOpen(20, true) 
    else 
    if (isGarageOpen(20)) then 
        setGarageOpen(20, false) 
    else 
        outputChatBox("You don't have permission to use this garage.", source, 255, 0, 255) 
    end 
    end 
    end 
end 
addCommandHandler("talli1", garage1) 

Edited by Guest
Link to comment
function garage1(thePlayer) 
if (getAccountName(getPlayerAccount(thePlayer)) == "Nikotuz") then 
    if (not isGarageOpen(20)) then 
        setGarageOpen(20, true) 
    else 
    if (isGarageOpen(20)) then 
        setGarageOpen(20, false) 
    else 
        outputChatBox("You don't have permission to use this garage.", thePlayer, 255, 0, 255) 
    end 
    end 
    end 
end 
addCommandHandler("talli1", garage1) 

Link to comment
function garage1(thePlayer) 
if (getAccountName(getPlayerAccount(thePlayer)) == "Nikotuz") then 
    if (not isGarageOpen(20)) then 
        setGarageOpen(20, true) 
    else 
    if (isGarageOpen(20)) then 
        setGarageOpen(20, false) 
    else 
        outputChatBox("You don't have permission to use this garage.", thePlayer, 255, 0, 255) 
    end 
    end 
    end 
end 
addCommandHandler("talli1", garage1) 

Not working, same problem

Link to comment
  • Other Languages Moderators
function garage1(player) 
    if getAccountName(getPlayerAccount(player)) == "Nikotuz" then 
        if isGarageOpen(20) then 
            setGarageOpen(20, false) 
            outputChatBox("Garage closed.", player, 255, 255, 255) 
        else 
            setGarageOpen(20, true) 
            outputChatBox("Garage opened.", player, 255, 255, 255) 
        end 
    else 
        outputChatBox("You don't have permission to use this garage.", player, 255, 0, 255) 
    end 
end 
addCommandHandler("talli1", garage1) 

Link to comment
function garage1(player) 
    if getAccountName(getPlayerAccount(player)) == "Nikotuz" then 
        if isGarageOpen(20) then 
            setGarageOpen(20, false) 
            outputChatBox("Garage closed.", player, 255, 255, 255) 
        else 
            setGarageOpen(20, true) 
            outputChatBox("Garage opened.", player, 255, 255, 255) 
        end 
    else 
        outputChatBox("You don't have permission to use this garage.", player, 255, 0, 255) 
    end 
end 
addCommandHandler("talli1", garage1) 

It works perfectly! Thank you tapl!

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