Mooclick server that only allows 2 players!
Hey,
I'm making a Battleship clone. I'm basically done with the whole game except for some bugs and graphics missing. Right now I'm trying to solve how I can make the game only accept 2 players. Since when someone else happens to join the same server everything goes crazy.
I have 1 server and 1 client(the game). How do I make it so that when the 3rd player joins he will get a big "NO!!" in the face and is thrown out before his presence can ruin the game for the other two playing?
If you need to see source I can upload it in the file archive on request.
Re: Mooclick server that only allows 2 players!
Make it so if there are more than 2 players besed on the Moo object it boots off the most recent player. Best I can say without seeing the .mfa.
Re: Mooclick server that only allows 2 players!
I can make it check for players but I have no idea how to find out the most recent player or how to kick a player using MooClick.
Re: Mooclick server that only allows 2 players!
Just end the application of the most recent player to boot them, I guess...
Re: Mooclick server that only allows 2 players!
well you could set an alterable value of the player when they enter to the number of players on the channel. Then if this alterable value is 3 then that person should be disconnected.
Re: Mooclick server that only allows 2 players!
I liked your idea KetchupMaster, but for some reason MooClick always returns 1 players value. No matter how many we are. This is when I do:
- On Sign On
+ Set Alterable Value(Active Object) to _CountPlayers( "MooClick" )
It's the same if I use the PC_CountUsers( "MooClick" ) and also in combination with the Is Signed On condition.
:(
Re: Mooclick server that only allows 2 players!
Well, post your file and we can see what we can do.
Re: Mooclick server that only allows 2 players!
The only thing you have to do is (server side)
Connection: On connect
Connection count >=2 ---disconnect
Re: Mooclick server that only allows 2 players!
don't you need to specify the channel somehow?
EDIT: this is my 100th post YAY!!!
Re: Mooclick server that only allows 2 players!
Quote:
I liked your idea KetchupMaster, but for some reason MooClick always returns 1 players value. No matter how many we are. This is when I do:
- On Sign On
+ Set Alterable Value(Active Object) to _CountPlayers( "MooClick" )
It's the same if I use the PC_CountUsers( "MooClick" ) and also in combination with the Is Signed On condition.
Do not do this in the OnSign On event, this fires before your moo click client is told of all the other users in the channel. Use the On user is here event.