For some reason GM commands won't appear on this code and I'm pretty sure I got everything right... yes I have recompiled, rebooted computer, restarted Dream Maker and all that:
var/const/MASTER_GM_PREFIX = "\[Master GM] "
var/const/ADMIN_GM_PREFIX = "\[Admin] "
var/const/GM_PREFIX = "\[GM] "
var/const/MASTER_KEY = "Blueseed15"
mob/Login() // Lets check to see if the players who login are a GM or not.
..() // Here we do the default procedure
if(usr.key == "Blueseed15") // Lets look up a key so we can give out GM verbs
usr.verbs += /mob/Admin/verb/Big_Boot // Lets add this verb to the GM
usr.verbs += /mob/Admin/verb/Boot // Lets add this verb to the GM
usr.verbs += /mob/Admin/verb/Reboot // Lets add this verb to the GM
usr.verbs += /mob/Admin/verb/Rename
else // If the players key is not the same as the persons key which is looked up above then the player does not get the GM verbs.
..() // Here we do the default procedure
mob/Admin/verb
Big_Boot(M as mob in world) // -- This is the same as "Boot".
set category = "Police"// -- This is the same as "Boot".
if(M:client)// -- This is the same as "Boot".
if(M:key == "Blueseed15")// -- This is the same as "Boot".
usr << alert("You can't boot Blueseed15")// -- This is the same as "Boot".
if(M:key == usr.key)
usr << alert("You can't boot yourself")
if(!M:key)
usr << alert("You can't boot NPCs")
else// -- This is the same as "Boot".
world << "[usr] sends a spell at [M] so powerful that even [M]'s spirit was destroyed."// -- This is the same as "Boot".
M:Logout()// -- This is the same as "Boot".
del(M)// -- This is the same as "Boot".
Boot(M as mob in world) // Boot verb -- Lets boot the troublesome fellows.
set category = "Police" // This sets the verb to the "Administration" panel
if(M:client) // This checks to see a specific character in the game, client wise.
if(M:key == "Blueseed15") // This checks to see if a certain character is online
usr << alert("You can't boot Blueseed15")// This alerts the user and tells them that they cannot boot whoever the character is that is looked up (For example, I am the person looked up, so therefore I cannot be booted.)
if(M:key == usr.key)
usr << alert("You can't boot yourself")
if(!M:key)
usr << alert("You can't boot NPCs")
else // If the player looked up is not the one being booted we go on from here
world << "[usr] causes [M] to disappear." // We tell the world that the player is booted.
M:Logout() // We logout the player here
del(M) // We delete the players traces/icon here.
Reboot() // Reboot verb
set category = "Police" // This sets the verb to the "Administration" panel
world << " Reboot!" //This tells the world that there is a Reboot
world.Reboot() // This reboots the world
Rename(mob/M as mob in world, ID as text)
set category="Police"
set desc="Change A Mob's ID"
M.name=ID
</<></<></<></<></< ></<>
ID:148130
Jun 30 2003, 8:07 am
|
|
In response to Drafonis
|
|
nope
|
In response to Blueseed15
|
|
Blueseed15 wrote:
nope Those should still be src anyway, even if changing them didn't fix your problem. Login() is only slightly usr-safe, and easy to break. Lummox JR |
Blueseed15 wrote:
mob/Login() // Lets check to see if the players who login are a GM or not. Two problems: The abundance of usr here is very bad (use src instead), and you're calling ..() twice for reasons I can't fathom. mob/Admin/verb That should be mob/M instead of just M, and then you can change all those colons to perions. M:key is dangerous and sloppy; M.key is not. When in doubt, type cast. Boot(M as mob in world) // Boot verb -- Lets boot the troublesome fellows.... Same deal. Rename(mob/M as mob in world, ID as text) That's the correct way to set up M, in this verb. Do the same in the others. Lummox JR |
In response to Lummox JR
|
|
The commands STILL won't appear...
|
In response to Blueseed15
|
|
Blueseed15 wrote:
The commands STILL won't appear... Well, most of the changes I suggested wouldn't affect that, but should be done regardless. However I would think the problem is still in mob/Login() or somewhere related. Is that your only Login() proc? Do you have other stuff involved in the login process? I'd have to see your updated Login() proc to tell. Lummox JR |
In response to Lummox JR
|
|
mob/Login()
src.oicon = src.icon src << "" mob/Logout() world << "[usr] has left this world." client/var/tmp world name = "Warriors of the Elements (Looking for map opinions, interior turf help, and better name suggestions... ignore the clothlessness for now... please)" mob = /mob/other/creating_character view = 6 tick_lag = 2 loop_checks = 0 client/proc/SaveMob() var/firstletter=copytext(src.ckey, 1, 2) var/savefile/F = new("players/[firstletter]/[src.ckey].sav") var/char_ckey = cKey(src.mob.name) F["/[ckey]/[char_ckey]"]<<src.mob client/proc/LoadMob(char_ckey) var/firstletter=copytext(src.ckey, 1, 2) var/savefile/F = new("players/[firstletter]/[src.ckey].sav") F["/[ckey]/[char_ckey]"]>>src.mob client/Del() if (istype(src.mob, /mob/other/creating_character)) return ..() src.SaveMob() return ..() mob/other/creating_character Login() spawn() src.CreateCharacter() proc CreateCharacter() var/list/characters = src.CharacterList() var/newCharacterChoice = "New Character" var/DeleteCharacterChoice = "Delete Character" var/list/menu = new() menu += characters menu += newCharacterChoice menu += DeleteCharacterChoice var/result = input("Character Creation", "WoE") in menu if (result == newCharacterChoice) src.CreateNewCharacter() if (result == DeleteCharacterChoice) src.DeleteCharacter() src.CreateCharacter() else var/success = src.client.LoadMob(result) if (success) del(src) else alert("Try again") src.CreateCharacter() CharacterList() var/firstletter=copytext(src.ckey, 1, 2) var/savefile/F = new("players/[firstletter]/[src.ckey].sav") F.cd = "/[ckey]" var/list/characters = F.dir return characters DeleteCharacter() var/firstletter=copytext(src.ckey, 1, 2) var/savefile/F = new("players/[firstletter]/[src.ckey].sav") F.cd = "/[ckey]" var/list/characters = F.dir var/CancelCharacterDeletion = "Decline" var/list/menu = new() menu += characters menu += CancelCharacterDeletion var/result = input("Delete character", "Character Selection") in menu if (result) F.cd = "/[ckey]" F.dir.Remove(result) if (result == CancelCharacterDeletion) src.CreateCharacter() else src.CreateCharacter() mob/other/creating_character/proc CreateNewCharacter() var/prompt_title = "Character Creation" var/help_text = "What is your character's name?" var/default_value = "" var/char_name = input(src, help_text, prompt_title, default_value) as null|text if (!char_name) src.CreateCharacter() return var/ckey_name = ckey(char_name) var/list/characters = CharacterList() if (characters.Find(ckey_name)) alert("There is a player that has chosen that name already. Please choose another well thought of name.") src.CreateNewCharacter() return help_text = "What sex is your character?" var/list/races = list("Male","Female") var/char_race = input(src, help_text, prompt_title, default_value) in races var/mob/new_mob switch(char_race) if("Male") new_mob = new /mob/player/student/boy new_mob.loc = locate(69,13,1) new_mob.name = char_name switch(input("What hair style do you want?", "Customization", text) in list ("Short1")) if("Short1") new_mob.hair = "Short1" var/hairred = input("How much red do you want to put into your hair? (255 is the brightest and 0 is the darkest.)") as num var/hairblue = input("How much blue do you want to put into your hair?) (255 is the brightest and 0 is the darkest.)")as num var/hairgreen = input("How much green do you want to put into your hair?) (255 is the brightest and 0 is the darkest.)") as num var/hairover = 'maleshort.dmi' hairover += rgb(hairred,hairgreen,hairblue) new_mob.rhair = hairred new_mob.ghair = hairgreen new_mob.bhair = hairblue new_mob.overlays += hairover world << "[char_name] has just entered '[world.name]'!" src.client.mob = new_mob if("Female") new_mob = new /mob/player/student/girl new_mob.loc = locate(69,13,1) new_mob.name = char_name switch(input("What hair style do you want?", "Customization", text) in list ("Female Long")) if("Female Long") new_mob.hair = "Female Long" var/hairred = input("How much red do you want to put into your hair? (255 is the brightest and 0 is the darkest.)") as num var/hairblue = input("How much blue do you want to put into your hair?) (255 is the brightest and 0 is the darkest.)")as num var/hairgreen = input("How much green do you want to put into your hair?) (255 is the brightest and 0 is the darkest.)") as num var/hairover = 'flong.dmi' hairover += rgb(hairred,hairgreen,hairblue) new_mob.rhair = hairred new_mob.ghair = hairgreen new_mob.bhair = hairblue new_mob.overlays += hairover world << "[char_name] has just entered '[world.name]'!" src.client.mob = new_mob new_mob.oicon = new_mob.icon new_mob.name = char_name src.client.mob = new_mob var/turf/first_location = locate(21,9,1) new_mob.loc = first_location del(src) mob/player student boy icon = 'tallbases.dmi' icon_state= "malebase" mob/player student girl icon = 'tallbases.dmi' icon_state= "femalebase" mob/Logout() del(src) mob Login() ..() if (!istype(src, /mob/other/creating_character)) sample_report() Write(savefile/F) ..() F["last_x"] << x F["last_y"] << y F["last_z"] << z Read(savefile/F) ..() var/last_x var/last_y var/last_z F["last_x"] >> last_x F["last_y"] >> last_y F["last_z"] >> last_z loc = locate(last_x, last_y, last_z) proc sample_report() That's only other login stuff... |
In response to Blueseed15
|
|
Okay, lots of problems in here. You have a lot of Login() procs conflicting with each other, and that's just part of it.
mob/Login() This is your first mob/Login() proc; you have another one later. mob/Logout() usr is not safe in Logout()--that should be changed to src. mob/other/creating_character This Login() is okay because it belongs to a different subtype: /mob/other/creating_character. Since you're using a character creation system, usr is definitely wrong in the regular mob/Login(). In that case usr ends up being the original mob you logged in with, the /mob/other/creating_character, and it doesn't match src anymore. mob Here's your second mob/Login(). This is totally unacceptable; don't set up more than one for the same type. if (!istype(src, /mob/other/creating_character)) This !istype() check is redundant because this mob will never be a /mob/other/creating_character. The reason is, mob/other/creating_character/Login() never calls ..() (that's a good thing--it shouldn't), so this proc won't ever be called when src is that type. That's only other login stuff... I actually asked to see how you'd changed the proc you originally posted, but you didn't post that. That makes three mob/Login() procs in total, and you need to combine them. The simple problem (now) is that the proc you posted at first is just never getting called because it's in conflict with two others. Lummox JR |
In response to Lummox JR
|
|
if (!istype(src, /mob/other/creating_character)) so should I delete everything with that? and now another problem, my boots will even work on myself when they aren't supposed to... |
In response to Blueseed15
|
|
Blueseed15 wrote:
if (!istype(src, /mob/other/creating_character)) No, I said the !istype() check is redundant; not that the rest was wrong. Just leave the sample_report() line, but unindent it; remove the if(). and now another problem, my boots will even work on myself when they aren't supposed to... Let's take care of the GM problem first, unless you've fixed it. Anyway, there's no point bringing this up without some code to look at. Lummox JR |
In response to Lummox JR
|
|
I fixed the GM problem, therwise boot wouldn't appear at all, so I wouldn't be able to use it, so I wouldn't have a chance of using it on myself, but, I will repost the code:
Big_Boot(mob/M as mob in world) // -- This is the same as "Boot". set category = "Police"// -- This is the same as "Boot". if(M.client)// -- This is the same as "Boot". if(M.key == "Blueseed15")// -- This is the same as "Boot". usr << alert("You can't boot Blueseed15")// -- This is the same as "Boot". if(M.key == usr.key) usr << alert("You can't boot yourself") if(!M.key) usr << alert("You can't boot NPCs") else// -- This is the same as "Boot". world << "[usr] sends a spell at [M] so powerful that even [M]'s spirit was destroyed."// -- This is the same as "Boot". M.Logout()// -- This is the same as "Boot". del(M)// -- This is the same as "Boot". Boot(mob/M as mob in world) // Boot verb -- Lets boot the troublesome fellows. set category = "Police" // This sets the verb to the "Administration" panel if(M.client) // This checks to see a specific character in the game, client wise. if(M.key == "Blueseed15") // This checks to see if a certain character is online usr << alert("You can't boot Blueseed15")// This alerts the user and tells them that they cannot boot whoever the character is that is looked up (For example, I am the person looked up, so therefore I cannot be booted.) if(M.key == usr.key) usr << alert("You can't boot yourself") if(!M.key) usr << alert("You can't boot NPCs") else // If the player looked up is not the one being booted we go on from here world << "[usr] causes [M] to disappear." // We tell the world that the player is booted. M.Logout() // We logout the player here del(M) // We delete the players traces/icon here. |
In response to Blueseed15
|
|
You can remove the M.Logout(), as del(M) also boots the mob.
The if(!M.key) with the alert isn't needed either because of the if(M.client). |
In response to Yoran91
|
|
thank you, that fixed the problem
|
I am not sure, but I think you should change the "usr"'s there into "src"'s.