Vice City: Multiplayer

Server Development => Scripting and Server Management => Topic started by: ℛḝξ☂ on Jul 21, 2018, 07:29 AM

Title: Fix spawn pos
Post by: ℛḝξ☂ on Jul 21, 2018, 07:29 AM
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.
Title: Re: Fix spawn pos
Post by: DizzasTeR on Jul 21, 2018, 08:05 AM
If you use a 500ms timer at onPlayerSpawn to teleport the player, it works fine.
Title: Re: Fix spawn pos
Post by: ℛḝξ☂ on Jul 21, 2018, 08:11 AM
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.
Title: Re: Fix spawn pos
Post by: ℛḝξ☂ on Jul 21, 2018, 11:26 AM
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!
Title: Re: Fix spawn pos
Post by: DizzasTeR on Jul 21, 2018, 11:49 AM
Don't think this will work for 2 or more players under certain scenarios.
Title: Re: Fix spawn pos
Post by: ℛḝξ☂ on Jul 21, 2018, 12:51 PM
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.
Title: Re: Fix spawn pos
Post by: =RK=MarineForce on Jul 22, 2018, 10:01 AM
function onPlayerSpawn( player )
{
player.Pos = Vector( 0,0,0 );
}

add this on scriptload

SetUseClasses( true );

this problem can be in request spawn i think