Sign in to follow this  
world

Send player to spawn

Recommended Posts

Hey.
I want to send the player to spawn using the cmd command, but the server shuts down (no errors) if I do it from scriptcommands.gsx

This not work (scriptcommands.gsx) :

case "testspawn":
  self thread maps\mp\gametypes\_globallogic::spawnPlayer();
  break;

 

This works (player.gsx) :

onConnect()
{
	self endon( "disconnect" );
	self thread test();
    
***

test()
{
	self endon("disconnect");
	while(true)
	{
		if ( self MeleeButtonPressed() )
		{
			self thread maps\mp\gametypes\_globallogic::spawnPlayer();
		}
		wait 0.3;
	}
}

What am I doing wrong?

@leiizko maybe

Edited by world

Share this post


Link to post
Share on other sites

your script is bad first after spawn you must save player coordinates after he spawn and after that you will be able to move player to this coordinates.

your server crashing because you trying to spawn player when player is already spawned so dont spawn player but move him

Share this post


Link to post
Share on other sites

No, I'm trying to move the players to one of the standard spawn points.

It works:

case "forcespawn":
 level notify("force_spawn");

*********************************

forceSpawn()
{
  self endon("disconnect");
  while(true)
  {
    level waittill("force_spawn");
	self thread maps\mp\gametypes\_globallogic::spawnPlayer();
  }
}

But I wonder why the server crashes if you call the function directly from the case block in scriptcommands.gsx

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this