ID:146910
 
I cannot make it to where the admin system actually works. Here's the code I have:
under admin:
mob
Admin
verb
Reboot()
set category = "Admin"
switch(input("Are you sure you want to reboot the server?","Reboot Server",text) in list("Yes","No"))
if("Yes")
world << "<font size=1><B><font color=blue>The server will be rebooted in <font color=red>5 seconds.</B>"
sleep(50)
world.Reboot()
Server_Shutdown()
set category = "Admin"
if(alert("Are you sure?","shutdown","Yes","No") == "Yes")
world << "<font size=1><B><font color=red>World is shutting down in 30 seconds!</font>"
sleep(300)
del(world)
Boot(mob/M in world)
set category = "Admin"
if (M.admin == 0)
world << "<font size=1><B><FONT COLOR=red>[M.key] has been booted by [usr].</B>"
del(M)
else
usr << "<font size=1><b><font color=red><B>Can't boot [M]."
M << "<font size=1><b><font color=red><B>[usr] tried to boot you."
return
Announce_V1(msg as text)
set category = "Admin"
world << "<font size=1><b><font color=blue><b><center>Announcement<BR>[usr]:<BR><font color=blue>-------------------------------<BR><font color=red>[msg]<BR><font color=blue>-------------------------------"
Admin_Chat(msg as text)
set category = "Admin"
for(var/mob/M in world)
if(M.admin == 1)
M << "<font size=1><B>[src] <FONT COLOR=red>Says to Admins:</FONT> [msg]"
Mute(mob/M in world)
set category = "Admin"
M.muted = 1
world << "<font size = 1><font color= red><B>[M] has been Muted by [usr]."
Un_Mute(mob/M in world)
set category = "Admin"
M.muted = 0
world << "<font size = 1><font color= red><B>[M] has been Un-Muted by [usr]."
Announce_V2(msg as message)
set category = "Admin"
usr.show = "[msg]"
Admin_Announce()
Login_On()
set category = "Admin"
Loginallowed = 1
world << "<font size=1><b><font color=red>Login on: People may now login to the server agian."
Login_Off()
set category = "Admin"
Loginallowed = 0
world << "<font size=1><b><font color=red>Login off: People may NO longer join this server."
Summon_All()
set category = "Admin"
switch(alert("Are you sure you want to summon everyone?","Server Info","Yes","No"))
if("Yes")
for(var/mob/M in world)
if(M.client)
M.loc = locate(usr.x,usr.y,usr.z)
Summon_Player(mob/M in world)
set category = "Admin"
if(M.client)
M << "<FONT SIZE=1><b>Admin [usr.name] has summoned you."
M:loc = usr.loc
Server_Name(msg as text)
set category = "Admin"
world.name = "[msg]"
world << "<B><font size=1><b><font color=blue>The server has been renamed to [msg]</B>"
Fly()
set desc = "() Toggle invisibility and lack of density"
set category = "Admin"
src.density = !density
usr << "<font size = 1><B>Density Toggled"
Teleport_To_Player(mob/M in world)
set category = "Admin"
M << "<font size = 1><b>Admin [usr.name] has teleported to you."
usr:loc = M.loc
Blind()
set category = "Admin"
var/varPeople = list()
for(var/mob/T in world)
varPeople += T
var/M = input("Who would you like to blind?","Blind") in varPeople + list("Cancel")
if(M != "Cancel")
M:sight |= BLIND
world << "<font size = 1><B>[M:name] has been blinded by [src.name]!</B>"
Unblind()
set category = "Admin"
var/varPeople = list()
for(var/mob/T in world)
varPeople += T
var/M = input("Who would you like to unblind?","Unblind") in varPeople + list("Cancel")
if(M != "Cancel")
M:sight &= ~BLIND
world << "<font size = 1><B>[M:name] has been Unblinded by [src.name]!</B>"
Restore_All()
set category = "Admin"
switch(alert("This will restore the worlds health to 100%. Do you want to do this??","Server Info","Yes","No"))
if("Yes")
for(var/mob/M in world)
M << "<font size = 1><B><font color=#999999>[usr] uses their power to restore the world's health.</B>"
M.health = M.maxhealth//Change these to your health variables
if("No")
return
Invisibility()
set category = "Admin"
src.invisibility = !invisibility
usr << "<font size = 1><B>Invisibility Toggled!"
Send_Player_XYZ(mob/M in world,X as num,Y as num,Z as num)///sends a player to any XYZ coords
set category = "Admin"
M.loc = locate(X,Y,Z)
M <<"<B><FONT SIZE = 1>You have been sent to the following location:[X],[Y],[Z]"
Kill_Player(mob/M in world)
set category = "Admin"
M.health -= M.maxhealth
M << "<FONT SIZE = 1><font color=red><B>The admin [usr] used his powers to auto-kill you."
M.death_check()
Announce_V3(message as message)
set category = "Admin"
for(var/mob/M in world)
if(M.player == 1)
var/html_doc = "<head><title>Announcment</title></head><body bgcolor=#000000 text=#FFFFFF><center><B><U><font color = red><font size=1><font face=Verdana>Announcement</U><BR>From: [usr]</font><BR><BR><font face=Verdana><font color=COCOCO>[message]"
src << browse(html_doc,"window=Announce")
Player_2_Player(mob/M1 in world,mob/M2 in world)
set category = "Admin"
M1.loc = locate(M2.x,M2.y+1,M2.z)
M1 << "<B><FONT SIZE = 1><font color =red>You were sent to [M2] by the admin [usr]."
M2 << "<B><FONT SIZE = 1><font color =red>The admin [usr] has sent [M1] to your location."
World_Mute()
set category = "Admin"
for(var/mob/M in world)
if(M.client)
if(M.admin == 1)
return
else
M.muted = 1
world << "<B><FONT SIZE = 1><font color =red>The Admin [usr] has Muted the whole world. (Admins may still talk)"
World_Un_Mute()
set category = "Admin"
for(var/mob/M in world)
if(M.client)
if(M.admin == 1)
return
else
M.muted = 0
world << "<B><FONT SIZE = 1><font color =red>The Admin [usr] has Un-Muted the whole world."

under Login:
#include <deadron/characterhandling>
client/base_num_characters_allowed = 1
mob
Login()
if(src.key=="Master JT")
src.admin = 1
Admin(src)
if(Loginallowed == 0)
if (src.admin == 1)
world << "<font size = 1><font color= Blue><B>Because [usr] is an admin, He/She was allowed to login."
src.loc=locate(1,1,1)
else
usr << "<font size = 1><font color= Blue><B>Sorry, Login is set to OFF."
sleep(10)
world << "<font size = 1><font color= Blue><B>[usr] tried to login but was not allowed."
del(src)
if(Loginallowed == 1)
usr.loc=locate(1,1,1)
mob
Login()
usr<<"Welcome to Absolute Destiny I"
switch(input("Choose one:")in list("New Game", "Continue", "Quit"))
if("New Game")
switch(input("By choosing this option you will delete an old character. OK?")in list("OK","Quit"))
if("OK")
usr.name = input("Name?")as text
alert("In this game you have the option of being Good or Evil. There are certain advantages to each side.")
alert("On the Dark side there is very little rules. You can do nearly anything without getting punished. However, there are more people on the dark side who would turn traitor in exchange for money or other items. Because of this You have to be very careful which side you choose.")
alert("On the side of the light you have more rules. Because of this you do not have to worry as much about traitors.")
switch(input("On the planet Briaris, all the races live in peace and harmony. But trouble is rising. Do you want to be on the side of evil and set out to conquer the world or do you wish to be good and wish for peace?")in list("Evil", "Good"))
if ("Evil")
usr.name = "[usr.name] (Dark)"
alert("You have chosen the side of Darkness. If you ever decide to change your mind it will be a long and hard journey before your new status is accepted.")
alert("The dark elf is a race unique to the side of the dark. Unlike their good counterparts, they can use weapons.")
alert("The Human can use weapons but unlike the dark elf they cannot use most offensive magic.")
alert("Gnomes are very good with weapons and some magic.")
alert("Dwarves are like gnomes in the fact that they strong weapons and magic skills.")
alert("Trolls are very good at weapons and at trap magic. They cannot change sides.")
switch(input("What is your race?") in list("Dark Elf", "Human", "Gnome", "Dwarf", "Troll"))
if("Dark Elf")
world<<"[usr.] has arrived as a Dark Elf. With his/her arrival the forces of darkness get stronger!"
if("Human")
world<<"[usr.] has arrived as a Human. With his/her arrival the force of darkness grow stronger!"
if("Gnome")
world<<"[usr.] has arrived as a Gnome. With his/her arrival the forces of darkness grow stronger!"
if("Dwarf")
world<<"[usr.] has arrived as a Dwarf. With his/her arrival the forces of Darness grow stronger!"
if("Troll")
world<<"[usr.] has arrived as a Troll. With his/her arrival the forces of Darkness grow stronger!"
usr.loc=locate(1,1,2)
if ("Good")
usr.name = "[usr.name] (Light)"
alert("You have chosen the side of the Light. It will be rather easy to change sides.")
alert("Elves are good at Magic but due to an oah all good elves adhere to, they cannot use weapons besides a staff.")
alert("The Human can use weapons but unlike the dark elf they cannot use most offensive magic.")
alert("Gnomes are very good with weapons and some magic.")
alert("Dwarves are like gnomes in the fact that they strong weapons and magic skills.")
alert("Fairies generally are best at healing. Novice fairies may use weapons, but after that they can only use magic. Generally fairies choose to work as a healer.")
switch(input ("What is your race?") in list("Elf", "Human", "Gnome", "Dwarf", "Fairy"))
if("Elf")
world<<"[usr.] has arrived as a Elf. We still have Hope."
if("Human")
world<<"[usr.] has arrived as a Human. We still have Hope."
if("Gnome")
world<<"[usr.] has arrived as a Gnome. We still have Hope."
if("Dwarf")
world<<"[usr.] has arrived as a Dwarf. We still have Hope."
if("Fairy")
world<<"[usr.] has arrived as a Fairy. We still have Hope."
usr.loc=locate(1,1,1)
if("Quit")
Logout()

under mob:
mob
mob
icon='player.dmi'
icon_state="bottom"
density=1
Head
icon_state="top"
layer=MOB_LAYER+99
density=1
pixel_y=31

Login()
..()
usr.overlays+=/mob/Head
verb
shout(msg as text)
if(usr.muted == 1)
usr << "<font size = 1><B>Your Muted!!!"
return
else
world << "<font size = 1><B>[usr]:</B> [msg]!"
Say(msg as text)
if(usr.muted == 1)
usr << "<font size = 1><B>Your Muted!!!</B>"
return
else
oview() << "<font size = 1>[usr]:[msg]"
whisper(msg as text)
if(usr.muted == 1)
usr << "<font size = 1><B>Your Muted!!!"
return
else
view(1) << "<font size = 1><I>[usr]:</I> [msg]"

under proc:
mob
proc
Admin(mob/M)
if (M.admin == 1)
M.verbs+=typesof(/mob/Admin/verb)
Admin_Announce()
for(var/mob/M in world)
if(M.player == 1)
html = {"<head><title>Announcment</title></head><body bgcolor=#000000 text=#FFFFFF><center><B><U><font color = red><font size=1><font face=Verdana>Announcement</U><BR>From: [usr]</font><BR><BR><font face=Verdana><font color=COCOCO>[usr.show]"}
M << browse(html)
death_check(mob/M as mob)
if(src.health <= 0)
if(src.client)
src << "<font size = 1><font color= blue><B>You were killed by [usr]!"
usr << "<font size = 1><font color= blue><B>You killed [src]!"
src.health = src.maxhealth
src.loc = locate(1,1,1)

under turf:
turf
dirt
icon='dirt.dmi'
wall
icon='wall.dmi'
density=1
grass
icon='grass.dmi'
path
icon='gravel.dmi'
house
icon='house.dmi'
destroyed_house
icon='destroyed house.dmi'
torch
icon='torch.dmi'
bookshelf
icon='bookshelf.dmi'
bridge
icon='bridge.dmi'
darkgrass
icon='darkgrass.dmi'
name="grass"
darkpath
icon='darkpath.dmi'
name="path"
area
town1
Entered()
usr<<"You are now in the town of Elize."

and under var:
mob
var
health = 100
maxhealth = 100
admin = 0
muted = 0
player = 1
show = ""
warnings = 0
var/html
var/Loginallowed = 1

I cannot find where the mistake is. if you see it, let me know.
What exactly do you mean, but I think I found a typo.

mob
Admin
verb
Reboot()
set category = "Admin"
switch(input("Are you sure you want to reboot the server?","Reboot Server",text) in list("Yes","No"))//take away ,text
if("Yes")
world << "<font size=1><B><font color=blue>The server will be rebooted in <font color=red>5 seconds.</B>"
sleep(50)
world.Reboot()

In response to Dark_Ninja_Corp.
You never actually said what is wrong here. So, the question is: What exactly IS the problem?
In response to Lenox
oh, i thought i said. the verbs for admin do not show up when the game is ran. and for some reason, you can go through walls.
btw, thanks for pointing out the typo. i'm not sure what it would have done to the game, if anything.
In response to Jamesburrow
Make sure under you variables that players density = 1 and make sure you have it
mob
Admin
verb
Reboot()



Think that's how it goes I dont do admin verbs very much but im pretty sure thats it.
In response to Dark_Ninja_Corp.
mob
Login()
if(src.key=="q")
src.verbs += typesof(mob/admin/verb/)

Bone are cool.
In response to Hell Ramen
Bone, OMG, he likes BONESSSS!!!!!! Lol
In response to Dark_Ninja_Corp.
Also, another word that doesn't belong?
Also, I think you should put, for example, instead of if(Login == 0), try if(!Login). I don't know, but i've seen many people suggest that you replace




if(ThisAndThat == 1)

with
if(ThisAndThat)







And

if(ThisAndThat == 0)



with


if(!ThisAndThat)





And as for the mistake?

mob
mob //This has no function..I do not believe.
icon='player.dmi'
icon_state="bottom"
density=1
Head
icon_state="top"
layer=MOB_LAYER+99
density=1
pixel_y=31

Login()
..()
usr.overlays+=/mob/Head
verb
shout(msg as text)
if(usr.muted == 1)
usr << "<font size = 1><B>Your Muted!!!"
return
else
world << "<font size = 1><B>[usr]:</B> [msg]!"
Say(msg as text)
if(usr.muted == 1)
usr << "<font size = 1><B>Your Muted!!!</B>"
return
else
oview() << "<font size = 1>[usr]:[msg]"
whisper(msg as text)
if(usr.muted == 1)
usr << "<font size = 1><B>Your Muted!!!"
return
else
view(1) << "<font size = 1><I>[usr]:</I> [msg]"
In response to Lenox
I never quite figured out what the (!blah) is for in other words what does ! do??
In response to Dark_Ninja_Corp.
Dark_Ninja_Corp. wrote:
I never quite figured out what the (!blah) is for in other words what does ! do??

It checks if something is equal to null, 0, or "".
In response to Hell Ramen
Oh, ok, thanks again Hell Ramen....
In response to Dark_Ninja_Corp.
Always good to help, or atleast attempt to. :p
In response to Hell Ramen
Lol.

if(usr.key== "Hell Ramen")
usr.verbs+=typesof(/mob/Helper/verbs)
usr.helper = 1



Lol, :p.
In response to Dark_Ninja_Corp.
Or, src.helper++, to my preference. :p
In response to Hell Ramen
Lol.
In response to Hell Ramen
Hell Ramen wrote:
> mob
> Login()
> if(src.key=="q")
> src.verbs += typesof(mob/admin/verb/)
>

Bone are cool.
no, that didn't work- it gave me this message:
loading Absolute Destiny.dme
Login.dm:4:error: missing expression

Absolute Destiny.dmb - 1 error, 0 warnings (double-click on an error to jump to it)
In response to Jamesburrow
Make a gm check proc, if you dont know how here is how...


This is the proc...
mob
proc
GMcheck()
if(usr.key == "Chwgt")
usr.verbs+=typesof(/mob/Elite/verb)


Then in the login..
mob
var
tiltle
Login()
alert("Welcome to [world.name]!")
switch(input("What do you want to do?")in list("Make new character", "Continue with old character", "Quit"))
if("Quit")
del(usr)
if("Make new character")
switch(input("Are you sure? If you have an old character, it will be erased.")in list("Continue", "Go Back"))
if("Go Back")
return ..()
if("Continue")
usr.name = input("Name?")as text
usr.loc = locate(15,13,1)
world << "[usr], [usr.key] has just logged in"
var/savefile/F = new(ckey)
Write(F)
if("Continue with old character")
var/savefile/F = new(ckey)
Read(F)
src.loc=locate(usr.lx,usr.ly,usr.lz)
usr.GMcheck()
world << "[usr], [usr.key] has logged in"



If that dont work then oh well...
In response to Dark_Ninja_Corp.
Whoops, I added an extra "/".
_>
Just remove it.
In response to Hell Ramen
Hell Ramen wrote:
Whoops, I added an extra "/".
_>
Just remove it.
with yours:
loading Absolute Destiny.dme
Login.dm:6:error:mob:undefined var
Login.dm:6:error:verb:undefined var
Login.dm:71::warning: operation has no effect here

Absolute Destiny.dmb - 2 errors, 1 warning (double-click on an error to jump to it)


and with dark ninja's:
loading Absolute Destiny.dme
Login.dm:5:error:/mob/Elite/verb:undefined type path
Login.dm:59::warning: operation has no effect here

Absolute Destiny.dmb - 1 error, 1 warning (double-click on an error to jump to it)
In response to Jamesburrow
No more help for you. :( (Read the bottom)
But I'll give you a hint!
No copy+paste. Ungh.
Page: 1 2