Jump to content

if() not working (please help) :(


AHSS

Recommended Posts

Posted

this is so annoying i dont get errors and its not working

what iam trying to do is this

function Save() 
local logged = getElementData(source, "logged") 
if(logged == "true") then 
--code 
end 
  

and i did this

function log(theplayer, command, password) 
--code 
setElementData(theplayer, "logged", "true") 
end 
  

and it doesnt work it doesnt do the function Save

i tried it with same code but another IF() (not using any element data)

i just checked if a file exist

like this

  
local pfile = xmlLoadFile(--file) 
if(pfile) then 
--same code in Save function without any change 
end 
  

and it worked so i know the problem is with IF()

know that i did this

function log(theplayer, command, password) 
local logged = getElementData(theplayer, "logged") 
if(logged == "false") 
--code 
else 
 outputChatBox("you are already logged in") 
end 
  

and the check goes correctly if i do log twice second time tells me that iam already logged in

please help what am i doing wrong :(

please help thanks

Posted

try to use another source, like

  
function Save(noob) 
local logged = getElementData(noob, "logged") 
if(logged == "true") then 
--code 
     end 
end 
  

and if you are using anything related to accounts, you need to give it rights, from ACL.XML

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