Fix spawn pos

Started by ℛḝξ☂, Jul 21, 2018, 07:29 AM

Previous topic - Next topic

ℛḝξ☂

Most of the time we don't want the player to teleport to his default spawn position, so we are changing player pos whenever he spawns, but this way isn't working properly for high ping players, they are teleported to where they should be before the default place, which means the player isn't spawning at the right place, so we need to use timer to correct it, but 1000ms timer still can't fix this properly, I want to ask for some better measure, thanks

If there's no other ways to solve this problem I hope we can have a function to disable/enable/change the default spawn position.
I may be a slow walker but I am always walking.

DizzasTeR

If you use a 500ms timer at onPlayerSpawn to teleport the player, it works fine.

ℛḝξ☂

Quote from: vitogta on Jul 21, 2018, 07:44 AM
Quote from: Rest on Jul 21, 2018, 07:29 AMMost of the time we don't want the player to teleport to his default spawn position
As I know to turn off inbuild LW-concept of gameplay with spawnlocs/skins/spawnwep by selection of skin there is a special function ::SetUseClasses(true); / ::SetUseClasses(false);
but it's bugged because player.Skin (and posssible something more) is desynced here.
Can't really figure out how to use this, it disables players to select their teams?

Quote from: Doom_Kill3R on Jul 21, 2018, 08:05 AMIf you use a 500ms timer at onPlayerSpawn to teleport the player, it works fine.

I'll have a try.
I may be a slow walker but I am always walking.

ℛḝξ☂

#3
Quote from: Doom_Kill3R on Jul 21, 2018, 08:05 AMIf you use a 500ms timer at onPlayerSpawn to teleport the player, it works fine.
It still occurs to me under 500ms >.<

Quote from: vitogta on Jul 21, 2018, 08:38 AM
Quote from: Rest on Jul 21, 2018, 08:11 AMCan't really figure out how to use this, it disables players to select their teams?
Yes, it removes conception of AddClass but it would be good only if stormeus will fix bugs related this function.

function onPlayerRequestSpawn( player )  SetUseClasses( false );
function onPlayerSpawn( player )
{
player.Pos = Vector( 1,2,3 );
SetUseClasses( true );
}
This way seems to be working well, thanks!
I may be a slow walker but I am always walking.

DizzasTeR

Don't think this will work for 2 or more players under certain scenarios.

ℛḝξ☂

Quote from: Doom_Kill3R on Jul 21, 2018, 11:49 AMDon't think this will work for 2 or more players under certain scenarios.
It did just now with 10+ players.

Quote from: vitogta on Jul 21, 2018, 11:55 AM
Quote from: Rest on Jul 21, 2018, 11:26 AMfunction onPlayerRequestSpawn( player )  SetUseClasses( false );
function onPlayerSpawn( player )
{
player.Pos = Vector( 1,2,3 );
SetUseClasses( true );
}
This way seems to be working well, thanks!
This is not good hack, it may cause some unexpected problems.
I'll try exploring it.
I may be a slow walker but I am always walking.

=RK=MarineForce

function onPlayerSpawn( player )
{
player.Pos = Vector( 0,0,0 );
}

add this on scriptload

SetUseClasses( true );

this problem can be in request spawn i think