Code:More Efficient
mob/Admin
verb
Tournament()
//set category = "Tournament"
switch(input("Host a tournament?","Tournament") in list ("Yes","No"))
if("Yes")
var/tname = input("What name for your tournament","Tournament") as null|text
if(!tname) {src << "Please, use an actual name!";return tname}
var/players = input("How, many players do you want to compete?","Tournament") as null|num
if(!players) {src<<"No player amount entered";return players}
else if(players > 8) {src<<"Only below an amount of 8 players can compete!";return players}
world << "<font color=red>WORLD EVENT!: [src] is hosting <b>[tname]</b> and only <i>[players] Players</i> can compete!</font>"
else if ("No") return 0
or
//This is not my code but i compiled this and it doesn't work whereas mine does i can't test it though since im at school
mob/verb
Tournament()//Forgot the brackets
set category = "Channels"
switch(alert("Host a tournament?","Tournament","Yeah!","I'll pass.."))
if("Yeah!")
var/tname = input("What name for your Tournament?","Tournament") as null|text
if(!tname)
src << "Please, use an actual name!"
return
var/players = input("How, many players do you want to compete?","Tournament") as null|num
else if(!players)
return
else if(players > 8)
src << "Only below <b>8</b> players can compete!"
return
world << "<font color=red>WORLD EVENT!: [src] is hosting <b>[tname]</b> and only <i>[players] Players</i> can compete!</font>"
Problem description: Just checking and want to know if like my return players will work etc
That should be if(players >= 8). Otherwise you could enter in 8 players and it wouldn't remind you to choose a number under 8.