Jump to content

getPlayerAccount


crismar

Recommended Posts

function openSniperGate(thePlayer) 
if tostring(getPlayerAccount(thePlayer)) == "crismar" then 
           moveObject (gate3, 3000, -2772.7, 233.5, 6.3) 
end 
end 
addCommandHandler("openpaty", openSniperGate, false) 

I have this code, trying to make the command restricted only to account 'crismar' but it won't work. It's relaly annoying, I tried everything, the script IS serversided, still no result :/

Link to comment

You're comparing an account element to a string, use this instead.

function openSniperGate(thePlayer) 
if (getAccountName(getPlayerAccount(thePlayer)) == "crismar") then 
           moveObject (gate3, 3000, -2772.7, 233.5, 6.3) 
end 
end 
addCommandHandler("openpaty", root, openSniperGate) 

Link to comment
You're comparing an account element to a string, use this instead.
function openSniperGate(thePlayer) 
if (getAccountName(getPlayerAccount(thePlayer)) == "crismar") then 
           moveObject (gate3, 3000, -2772.7, 233.5, 6.3) 
end 
end 
addCommandHandler("openpaty", root, openSniperGate) 

worked, cheers

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