I am try to make it so that the list of Admins for my game is on the hub. So I don't have to code in every byond key, So that if I add or remove a Admin I don't have to update the code and update the game. Here is the save file for my Admins
world
New()
..()
var/savefile/F = new ("m_admin.sav")
F["GM"] >> GM
if(isnull(GM))
GM = new /list
F["Admin"] >> Admin
if(isnull(Admin))
Admin = new /list
F["banned"] >> banned
if(isnull(banned))
banned = new /list
Del()
var/savefile/F = new ("m_admin.sav")
F["GM"] << GM
F["Admin"] << Admin
F["banned"] << banned
How do you call the hub? I looked over the HubfilesDemo and it made almost no sence at all. I shwed me how it could be used, but not how to call it. Thanks in advance for the help.
TK6000
ID:173744
![]() Nov 21 2003, 8:20 pm
|
|
![]() Nov 21 2003, 8:25 pm
|
|
I'd suggest setting up a subscription based system of Administrators using the HUB. Because I do believe the thing you're speaking of costs money to rent storage space. But, all you need to do is make a new HUB entry, make a subscription to it then add/remove keys manually without having to upload a new version/patch every time an Admin's being "bad"...
|
I am actualy talking about Admins for a game I made. I will look into what you sugested, sounds like it will work fine. One more question, how do you call subscribers?
|
CheckPassport proc (client)
Format: CheckPassport(passport_identifier) Args: passport_identifier: a text string assigned to you by BYOND Hub. This built-in procedure checks to see if the user is subscribed to a particular BYOND Hub entry. Example: world hub = "My.Hub" //change this to your own hub entry client/var full_access mob/Login() if(client.CheckPassport("0123456789abcdef")) full_access = 1 else usr << "For full access, <a href = \ 'http://www.byond.com/hub/[world.hub]' >subscribe!" return ..() Note that in general the value of world.hub has nothing to do with the passport you happen to check. This example assumes the passport number belongs to world.hub just for the purpose of forwarding the user to the appropriate subscription page. |
Thanks, I am having a problem with it though. Here is my code.
mob proc DoTheGM() if(client.CheckPassport("*beep* Not showing this")) if(usr.gmrank >= 1) world << "GM [usr] has joined" alert("Welcome [usr], your GM powers are ready for you.") else world << "GM [usr] has joined" GM += usr.key usr.AddGMVerbs() alert("Welcome [usr], your GM powers are ready for you.") That does nothing, and I have the right identafer. Whats up? |
That should work fine though right? Because it is the usr of the proc. Am I wrong? Should I use something else?
|
Simply put: usr!=src.
"usr" does NOT equal src. "usr" is the one who called the proc, not necessarily the one that will be affected by it. src on the other hand though is the mob that called it and in most cases (unless you specify otherwise) is who's being affected. If you wish to know more I do believe there's an article by Lummox somewhere's on BYONDScape about it, but I can't seem to find it right now. |
http://bwicki.byond.com/ByondBwicki.dmb?UsrIsEvil
http://www.byondscape.com/ascape.dmb/LummoxJR.2002-1104/ Goku72, usr is not necesarilly the one who called the proc. Src also may not be the mob that called the proc! |