ID:145332
 
Code:
mob/Login()
if(!loc)
loc = locate("start")

mob/Login()
if(!loc)
loc = locate("start")

mob
Login()
..()
loc = locate(10,10,2)

world
mob = /mob/Choosechar

client
proc
Load_Char()
var/savefile/S = new ("Player/[src.mob.ckey]")
S["mob"] >> src.mob
S["x"] >> src.mob.x
S["y"] >> src.mob.y
S["z"] >> src.mob.z
Save_Char()
var/savefile/S = new ("Player/[src.mob.ckey]")
S["mob"] << src.mob
S["x"] << src.mob.x
S["y"] << src.mob.y
S["z"] << src.mob.z

client
New()
..()
world << "<font color=white>[src.mob] Has Entered The Game."
Del()
world << "<font color=white>[src.mob]<font color=white> Has Left The Game."
src.mob.client.Save_Char()
del(src.mob)

mob/Choosechar
Login()
spawn()
src.Choose_Char()
proc//we start with the procs
Choose_Char()
var/list/char_menu = newlist()
var/Create = "Create New Character"
var/Load = "Load Character"
var/Quit = "Exit"
if(fexists("Player/[src.client.ckey]"))
char_menu.Add(Create,Load,Quit)
var/choice = input("What do you want to do?","Kingdom Hearts: The Door of Darkness.") in char_menu

if(choice == Create)
switch(alert("Creating a New Character will delete your existing character. Continue?","Warning","Yes","No"))
if("Yes")
Create_Char()
if("No")
Choose_Char()
return
if(choice == Load)
src.client.Load_Char()
if(choice == Quit)
del(src)
else
char_menu.Add(Create,Quit)
var/choice = input("What do you want to do?","Welcome to [world.name]!") in char_menu

if(choice == Create)
Create_Char()
if(choice == Load)
del(src)

..()

Create_Char()
var/mob/mob_created
var/world_name = "[world.name]"
var/value = key
var/text = "What would you like your name to be?"
var/name = input(src, text, world_name, value)as text
if(!name)
src.Create_Char()
return

var/choose_char = input("What would you like to be?")in list("Sora")
switch(choose_char)
if("Sora")
mob_created = new/mob/Sora()
mob_created <<"You are Sora."

mob_created.loc = locate(10,10,2)
mob_created.name = name
src.client.mob = mob_created

mob
Sora
icon = 'sora2.dmi'


Problem description:When i host my game ni1 can log in? is there a problem with this code or... Can anyone please fix my code. thank you.

If no one can login it's or;
1. Byond is down
2. Your firewall is on and blocking you from hosting
3. Router is not portforwarded

If they get blackscreened, I very much doubt you can locate to a text string.
In response to Mysame
I Don't think these are my problems..maybe its the code, im not sure, any more help please?
In response to Bamrulez
download a game and try hosting. if no one gets in. Its you, not the code.
Well yes, there are problems with your code, such as the one where Choose_Char() is calling itself without using spawn(), or indeed instead of using a simple while() loop which is infinitely better.

But those are unrelated to why no one can log in. Obvious answer: You're behind a firewall or router that's configured incorrectly.

Lummox JR
In response to Lummox JR
Ok thanks, i'll have to get a hoster then. Thank you all.
In response to Bamrulez
Bamrulez wrote:
Ok thanks, i'll have to get a hoster then. Thank you all.

No, all you have to do is reconfigure your firewall and/or router.

Lummox JR