| Blockland Forums > Modification Help |
| Stopping latejoiners |
| << < (2/3) > >> |
| Iban:
--- Code: ---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); } } } --- End code --- This is pseudocode. Do not use it directly. I hope you can figure what to plug in. |
| Destiny/Zack0Wack0:
--- Code: ---$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."); } } --- End code --- |
| Chrono:
Don't use .kill, that'll subtract points and other things. Just delete them and set a control object. |
| cucumberdude:
Thanks. |
| cucumberdude:
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? |
| Navigation |
| Message Index |
| Next page |
| Previous page |