Author Topic: Stopping latejoiners  (Read 859 times)

I stuck this at the bottom of the TDM code

Code: [Select]
//ADDED TO STOP LATEJOINERS
function GameMode_TDM_onAddMember(%mini,%client)
{
%client.player.kill();
messageClient(%client, '', "\c6You will spawn next round!");
}

It ain't workin'

Any ideas?

Try adding a schedule to the killing.



Tom

Is onAddMember an existing callback?

Code: [Select]
function GameMode_TDM_onAddMember(%mini,%client)
{
// If our join time is after 10 seconds. Correct the property name.
if(%mini.PSEUDO_ROUND_START_TIME - $sim::time > 10)
{
// I don't know this property name, either.
%client.TDM_Lives = 0;
messageClient(%client, '', "\c5Round in Progress!\nPlease Wait", 3);

if(isObject(%client.player))
{
%client.player.delete();
%client.setControlObject(%client.camera);
}
}
}

This is pseudocode. Do not use it directly. I hope you can figure what to plug in.

Code: [Select]
$LateSpawningTime = 10000;
function GameMode_TDM_onModeStart(%mini,%client)
{
//Called when you start the game mode, AFTER minigame is reset.
%mini.roundStartedAt = getSimTime();
}
function GameMode_TDM_onClientSpawn(%mini,%client)
{
//Called after a player is spawned and tools/etc. are given
if(getSimTime() - %mini.roundStartedAt >= $LateSpawningTime && isObject(%client.player))
{
%client.tdmLives = 0;
%client.player.kill();
messageClient(%client,'',"You spawned late. You need to wait until the next round now.");
}
}
« Last Edit: March 26, 2011, 11:04:11 PM by Destiny/Zack0Wack0 »

Don't use .kill, that'll subtract points and other things. Just delete them and set a control object.


For some reason, that does nothing except make it so that when I player jumps he is put into spectate mode.

EDIT: Okay, so basically what happens is:

I start a minigame.

I reset it.

I get the latejoiner message but my player is not killed, and if I press space I go into spectate mode.

WTF?
« Last Edit: March 27, 2011, 03:29:44 PM by cucumberdude »


That was kind of pointless...

Anyways, I got it working.

How did you get it to work?

packaged minigame onjoin or whatever

Dimesion M has a script that stops people from joining server when the server starts.

That could be helpful,hmmm?