SunTzu16
|
  |
| Joined: 10 Jul 2012 |
| Total Posts: 999 |
|
|
| 23 Aug 2013 11:04 AM |
So a guest has an ID of 0, right?
I have a chat based command for tool storage in a survival game, and I need to make a separate system using a text box for guests to benefit from the same functionality.
Are there any other ways to detect guests, for future reference?
Philosopher, Creator, Clanner, Wiki Writer, and Student |
|
|
| Report Abuse |
|
|
|
| 23 Aug 2013 11:06 AM |
| umm not always...I recommend maybe using the accountAge because that seems to have a greater way of detecting them...or just detect if there is a space in the players name..which all guests have and no player has. |
|
|
| Report Abuse |
|
|
|
| 23 Aug 2013 11:06 AM |
| Their account age would most likely be 0 as well. |
|
|
| Report Abuse |
|
|
SunTzu16
|
  |
| Joined: 10 Jul 2012 |
| Total Posts: 999 |
|
|
| 23 Aug 2013 11:08 AM |
Some players have a space.
Those who have really old accounts, at least.
ID == 0 glitches? I wonder why.
Philosopher, Creator, Clanner, Wiki Writer, and Student |
|
|
| Report Abuse |
|
|
blocco
|
  |
| Joined: 14 Aug 2008 |
| Total Posts: 29474 |
|
|
| 23 Aug 2013 11:11 AM |
Guests have negative IDs. If you do not know this, you cannot be declared a knowledgeable exploiter.
Guests. Have. Negative. IDs. And. Their. Name. Contains. The. Last. Four. Digits. Of. Their. IDs.
ok |
|
|
| Report Abuse |
|
|
|
| 23 Aug 2013 11:12 AM |
if string.sub(player.Name,1,6) == "Guest " then print("Guest") end
|
|
|
| Report Abuse |
|
|
SunTzu16
|
  |
| Joined: 10 Jul 2012 |
| Total Posts: 999 |
|
|
| 23 Aug 2013 11:13 AM |
I'm not an exploiter...
ok...
Some people might be called "Guest 3435" or something, @Sea.
So, I just need to reverse the string of their name, grab the last 4 digits, and check if it is equal to their ID?
Shouldn't be too hard.
Philosopher, Creator, Clanner, Wiki Writer, and Student |
|
|
| Report Abuse |
|
|
SunTzu16
|
  |
| Joined: 10 Jul 2012 |
| Total Posts: 999 |
|
|
| 23 Aug 2013 11:14 AM |
Or maybe just"ID < 0"
lol
Philosopher, Creator, Clanner, Wiki Writer, and Student |
|
|
| Report Abuse |
|
|
blocco
|
  |
| Joined: 14 Aug 2008 |
| Total Posts: 29474 |
|
|
| 23 Aug 2013 11:17 AM |
function isGuest(player) return not not player.Name:find( (-player.userId) % 10000 ) end
or as said above
function isGuest(player) return not not string.match("^Guest ") end |
|
|
| Report Abuse |
|
|
|
| 23 Aug 2013 11:17 AM |
It's very unlikely that you'll get a normal user with the word "Guest" and a space in their name.
You could also just use that ID thing. |
|
|
| Report Abuse |
|
|
blocco
|
  |
| Joined: 14 Aug 2008 |
| Total Posts: 29474 |
|
|
| 23 Aug 2013 11:17 AM |
| Although I would use the second code snippet. The first one is unreliable. |
|
|
| Report Abuse |
|
|
SunTzu16
|
  |
| Joined: 10 Jul 2012 |
| Total Posts: 999 |
|
|
| 23 Aug 2013 11:19 AM |
Why use "not not"
Seems sort of redundant to me. lol
Philosopher, Creator, Clanner, Wiki Writer, and Student |
|
|
| Report Abuse |
|
|
SunTzu16
|
  |
| Joined: 10 Jul 2012 |
| Total Posts: 999 |
|
|
| 23 Aug 2013 11:21 AM |
Probably is unlikely to find someone with a name like that, but I guess it doesn't matter. If a player with an account plays, the extra text box won't affect him.
Philosopher, Creator, Clanner, Wiki Writer, and Student |
|
|
| Report Abuse |
|
|
blocco
|
  |
| Joined: 14 Aug 2008 |
| Total Posts: 29474 |
|
|
| 23 Aug 2013 11:28 AM |
| `not not` is an idiom which returns it as a bool instead of some other wishy-washy datatype |
|
|
| Report Abuse |
|
|
blocco
|
  |
| Joined: 14 Aug 2008 |
| Total Posts: 29474 |
|
|
| 23 Aug 2013 11:32 AM |
| lel, you notice i left something out in my code :3 |
|
|
| Report Abuse |
|
|
SunTzu16
|
  |
| Joined: 10 Jul 2012 |
| Total Posts: 999 |
|
|
| 23 Aug 2013 12:15 PM |
I ended up thinking that, the whole bool thing, a bit later...
Makes sense now, the not not gives you the right data type.
Philosopher, Creator, Clanner, Wiki Writer, and Student |
|
|
| Report Abuse |
|
|
SunTzu16
|
  |
| Joined: 10 Jul 2012 |
| Total Posts: 999 |
|
|
| 23 Aug 2013 12:16 PM |
"player" is an argument, and you're supposed to be checking its name, but nowhere in the code does it do that.
My best guess.
Didn't really pay that much attention.
Philosopher, Creator, Clanner, Wiki Writer, and Student |
|
|
| Report Abuse |
|
|
|
| 23 Aug 2013 12:19 PM |
| I never knew the "last 4 digit ID" bit... That is interesting... Does this mean I can get two Guest 2952s with different IDs but the same last 4 digits in the same server? |
|
|
| Report Abuse |
|
|
SunTzu16
|
  |
| Joined: 10 Jul 2012 |
| Total Posts: 999 |
|
|
| 23 Aug 2013 12:20 PM |
Does it let guest names repeat?
If it goes from 1000 to 9999, then I don't think it needs to, so why wouldn't it prevent repeats?
I've seen a 9999 before, it was my friend who hadn't logged on. (Either that or me, I don't remember which... so long ago).
Philosopher, Creator, Clanner, Wiki Writer, and Student |
|
|
| Report Abuse |
|
|
|
| 23 Aug 2013 12:22 PM |
| *1 to 9999. You forget guests with "0001" as the end of their ID. |
|
|
| Report Abuse |
|
|
| |
|
SunTzu16
|
  |
| Joined: 10 Jul 2012 |
| Total Posts: 999 |
|
|
| 23 Aug 2013 12:23 PM |
wasn't sure if they'd go under 1000
Makes sense to add those extra digits though
Philosopher, Creator, Clanner, Wiki Writer, and Student |
|
|
| Report Abuse |
|
|