ID:270849
 
I'm wondering if it was possible to make a verb lets call it maketournament. When u press it, It says 'you have 5 minutes to join tournament' and then all users online get a 'join' verb so they can join the tournament. When they click join, they get transported to the location of the tournament. When those 5 minutes are done. The 'join' verb dissapears.
and only because I don't really care about DBZ games anymore... I'm not even going to pick at you for the post... Or the bump.

var
tournament = 0
tournamentx = 1
tournamenty = 1
tournamentz = 1
mob
verb
join_tournament()
if(tournament)
src.loc = locate(global.tournamentx,global.tournamenty,global.tournamentz)
src.verbs -= /mob/verb/join_tournament
Login()
spawn()
..()
if(!tournament)
src.verbs -= /mob/verb/join_tournament()
GM
verb
begin_tournament()
global.tournament = 1
for(var/mob/M in world)
if(M.client)
M.verbs += /mob/verb/join_tournament
world << "A tournament is about to begin! You have five minutes to enter!"
spawn(3000)
world << "The tournament has begun!"
for(var/mob/M in world)
if(M.client)
M.verbs -= /mob/verb/join_tournament
global.tournament = 0


Now, the reason I give this to you, is because actually conducting the tournament is MUCH, MUCH harder... Don't even ask me for that bit of code. Because, well, I'm not going through that kind of trouble for you.
In response to Ter13 (#1)
and where should i put the location of my tournament arena?
or do i just need to add a usr.loc = locate(x,y,z) when u join the tournament?
In response to Ultimate Productions (#2)
I think this is a slightly more efficient version:

var
tournament = 0
tourny_loc = locate(5,5,1)

mob
verb/Join()
if(tournament)
loc = tourny_loc
verbs -= /mob/verb/Join

return 1

return 0

Login()
..()
if(!tournament && (/mob/verb/Join in verbs))
verbs -= /mob/verb/Join

else if(tournament && !(/mob/verb/Join in verbs))
verbs += /mob/verb/Join

return 1

GM
verb/Begin()
tournament = 1

for(var/client/c)
c.mob.verbs += /mob/verb/Join

world << "Blah blah blah tournament yadda yadda yadda."

spawn(80)
world << "Blah blah blah begun yadda yadda yadda."

for(var/client/c)
c.mob.verbs -= /mob/verb/Join

tournament = 0

return 1


As you can see, instead of checking for every mob in the world and then checking if he is a client, I simply checked for clients and refered to their mobs. Also, I used locate() instead of setting the x,y,z variables seperately.
In response to DivineO'peanut (#3)
and how do u make a complete tournament system so that people join. And that player1 vs player2, player3 vs player4 etc. And winner of each fight gets to next round. If there is a unpair number of players, a player can get auto to next round. If u win tournament u get a prize that any GM can attribute.
In response to DivineO'peanut (#3)
else if(tournament && !(/mob/verb/Join in verbs))
verbs += /mob/verb/Join


True, while you did find a few of my conceptual flaws, I will point to these two lines.

These two lines in the Login() procedure are completely superfluous.

This is because the user will ALWAYS have this verb on login. Unless of course, you have saved the verb list in a savefile, which is just a horrid idea for three reasons:

1) Security reasons
2) Savefile size reasons
3) updatability reasons

The verbs list should never be saved, thus, those two lines you added to my code should never be there in the first place.

Though, the user will still have this verb on login if the verbs list has been loaded from a savefile, come to think of it. Seeing as loading the verbs list will only load the verbs that were added to the list, and not take away those that weren't saved.

=P Just FYI. Good work, though.
In response to Ter13 (#5)
Yeah, I noticed that, but I thought he might want the verb to belong to a certain type(for more idea what the verb does and the such), so I saved him some work. :p

Plus, never argue with bulletproof code!