Author Topic: Screen bug  (Read 1438 times)

For an Add-On I'm making I have it so that when players die they can't respawn. I'm using a default script found in the speed kart code to delete the player and put them in spectate mode, but the screen goes nuts.

Code: [Select]
%player = %client.player;

%player.delete();
      %camera = %client.camera;
      %camera.setFlyMode();
      %camera.mode = "Observer";
      %client.setControlObject(%camera);

Any ideas on what's going on?

Try deleting the player at the end.

Try deleting the player at the end.

No.

Use the .setOrbitMode function instead of .setControlObj function.

No.

Use the .setOrbitMode function instead of .setControlObj function.

Did this and deleting player at the end still getting







 Crazy screen bug


 

Because you did it wrong. Post your code.

Because you did it wrong. Post your code.

Here's the snippet of code dealing with respawning
Code: [Select]
function PlayerL4DSurvivorArmor::ondisabled()
{
$liveplayers--;

echo("Someone died");

parent::ondisabled();

        %player = %client.player;

if($Initialized == 1)
{
%player.delete();

      %camera = %client.camera;
      %camera.setFlyMode();
      %camera.mode = "Observer";
      %client.setOrbitMode(%camera);


Isalldead();

}
else
{
        //Don't know which function actually works but one does so keep them all in
%client.respawn();
%player.respawn();
%client.player.respawn();

%client.player.InstantRespawn();
%player.InstantRespawn();
%client.InstantRespawn();
}

}

delete the player at the end *cough*elm*cough*

delete the player at the end *cough*elm*cough*

What?

Also, you aren't using the setOrbitMode function correctly.
« Last Edit: June 06, 2013, 03:43:13 PM by elm »

Also, you aren't using the setOrbitMode function correctly.
Then how about you tell us how to use it correctly

This is my entire spectator code. You'll need to change some things but this should be a good framework.

http://pastebin.com/k61yHwRN

This is my entire spectator code. You'll need to change some things but this should be a good framework.

http://pastebin.com/k61yHwRN

Thanks I thought about using Slayer for reference but I didn't know where to look for spectator code... laziness beat me.