List Bug.. in Developer Help
|
|
Code:
mob verb Ban(mob/M in world) set category = "Staff" switch(input("Are you sure you wish to ban [M] from the game?","Ban Confirmation")in list("Yes","No")) if("Yes") if(M.key in staff) usr << "You are not allowed to ban staff members." return keyb += M.key ipb += M.client.address compidb += M.client.computer_id var/daysbanned = input("How many days do you wish to ban [M] for? (Put 0 if you want to perm ban)","Ban")as num var/unbanday = world.realtime + (864000*daysbanned) world << "[M] has been banned from the game." Add_To_Banlog(M.key,M.client.address,M.client.computer_id,time2text(world.realtime,"DD-MMM-YY"),daysbanned,time2text(unbanday,"DD-MMM-YY")) SaveBan()
mob Login() ..() src.CheckBan() players += src world << "[src] logged in!"
Logout() ..() players -= src world << "[src] logged out!"
proc CheckBan() if(src.key in keyb||src.client.address in ipb||src.client.computer_id in compidb) src << "[src], you are currently banned..." else src << "Welcome, [src]."
var list keyb = list() ipb = list() compidb = list() staff = list() players = list()
|
Problem description:
When I make a verb to test what's in the list:
mob/verb/Test() var/list/T = list() for(var/M in keyb) T += M var/i = input("Bla")as anything in T + "Cancel" usr << i
|
Cut it only shows cancel.
When I look in a sav file editor at the sav file for the ban sav, it shows the keys in the ban sav like so:
KeyBan = "Guild_CSSGuild_CSSGuild_CSSGuild_CSSGuild_CSSGuild_CSSGuild_ CSSGuild_CSSGuild_CSSGuild_CSSGuild_CSSGuild_CSSGuild_CSSGui ld_CSSGuild_CSSGuild_CSSGuild_CSSGuild_CSSGuild_CSSGuild_CSS Guild_CSSGuild_CSSGuild_CSSGuild_CSSGuild_CSSGuild_CSSGuild_ CSSGuild_CSSGuild_CSSGuild_CSSHoweyHoweyHoweyHoweyHoweyHowey HoweyHoweyHoweyHoweyHoweyHoweyHoweyHoweyHoweyHoweyHoweyHowey TralinThe One With Dots"
howey = object(".0")
.0
type = /mob
name = "Howey"
gender = "male"
key = "Howey"
Any ideas?
|
Incidentally, as anything in list+"Cancel" is not a good way to implement a cancel option. That should be as null|anything in list instead.
Lummox JR