Hello,
How can i detect if someones key has guest in it ? before we just checked the name but since the new byond 4.0 gives the guest a name like Guest-123456789 its really annoying to detect.
Thanks
ID:272477
Jul 29 2008, 2:56 pm
|
|
Jul 29 2008, 3:04 pm
|
|
Look up the findtext() and findText() procs in the DM reference.
|
Sasuke_Kun52 wrote:
Hello, All the BYOND 421+ guest keys are of the format "Guest-[number]", so you should be able to do this: proc/IsGuestKey(key) Lummox JR |
In response to Lummox JR
|
|
Lummox JR wrote:
Sasuke_Kun52 wrote: proc/IsGuestKey(key) Lummox JR .> that looks like a really good addition for a new DM update (nudge nudge developers, whomever they are) |
In response to Sctjkc01
|
|
Sctjkc01 wrote:
that looks like a really good addition for a new DM update (nudge nudge developers, whomever they are) That would be Lummox, although I don't think it needs to be added since it's easy enough to check for. The only problem could be if someone actually created a key called Guest-[number]... |
In response to Nickr5
|
|
OK, is there a way to check if he is actually a guest even if his key is say guest-453354435 ??? Because even checking key, their key could be that as well.
No kind of variable that is boolean for is-guest? Also, how do you block all guests from your game besides checking the name? Is there a way? |
In response to Superbike32
|
|
No, right now there's no other way (since guests are a new addition to BYOND). However, it's possible that BYOND won't allow you create a key in the Guest-name format. Even if they do allow it, I don't think anyone would be stupid enough to create a Guest key to play in a game where guests aren't allowed. It wouldn't kill them to create a new key if they did, though.
|
In response to Nickr5
|
|
'Guest' is a reserved word, so you can't make a key with it. The BYOND Staff knows their stuff. (rhyme intended) :P
|
In response to Kaioken
|
|
Well, still, I would feel much better having a variable containing whether or not its a guest key. It would save me some copying and pasting, and it would be a built in function, so that we cant really mess up if we know what variable it is, and know how a boolean variable saves the data...hahaha
|
In response to Superbike32
|
|
That'd be a waste of a built-in variable. =P You've got Lummox JR's code right here, you can copy it once and you can use the proc all you like, or set your own custom variable when a player logs in. Since you can already easily detect it because a player can't actually create a key in the Guest-#num format, this is enough and you don't really need a built-in variable.
If anything, you'd have that proc built-in, which would be nice and similar to how you've got IsBYONDMember(). |