Jump to content




Door Program Help


1 reply to this topic

#1 popdog15

  • Members
  • 82 posts

Posted 19 August 2013 - 06:38 PM

Whenever I right click the player detector, nothing happens. At all. I've got my own username in the playerList file, too. No error comes up; just nothing happens.
http://pastebin.com/FRucq6TK

Oh, and I failed to mention that the chatRead() function is unfinished and should be disregarded.

#2 LBPHacker

  • Members
  • 766 posts
  • LocationBudapest, Hungary

Posted 20 August 2013 - 02:33 AM

I think the problem is with getPlayerData. First of all, it tries to open playerList if it doesn't exist (playerList == false). Then (suppose it was able to open playerList) it tries to compare a string returned by .readAll with a boolean, which sure will evaluate false.

Next problem: around like 38, you open playerList (opening it in "w" mode causes it to clear), and overwrite every name with a single one. Either you should use "a" (append) mode or you should store the usernames in a table (tutorial about saving tables). And you should close the file handle somewhere as well (closing it is actually what flushes the contents of the file).

And use locals.

Here's what I thought it should look like. It should work, but I haven't tested it.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users