PAWN Lang Scripting Questions
#9

Suppose the best way to do it would be to add a var when they die, check that when they spawn.

Code:
public OnPlayerDeath(playerid, killerid)
{
  SetPlayerPos(playerid, 0.0, 0.0, 0.0);
  TogglePlayerControllable(playerid, 0);
  SetPlayerCameraPos(playerid, -2493.41, 645.15, 78.87);
  SetPlayerCameraLookAt(playerid, -2498.31, 644.39, 78.19);
  TextDrawShowForPlayer(playerid, Text:RecoveryText);

  Recovering[playerid]=1;
 
  SetTimerEx("DeathRecovery", 25000, 0, "i", playerid);
  return 1;
}

public DeathRecovery(playerid)
{
  Recovering[playerid]=0;

  TogglePlayerControllable(playerid, 1);
  SetCameraBehindPlayer(playerid);
  TextDrawHideForPlayer(playerid, Text:RecoveryText);

  SpawnPlayer(playerid);
  SetCameraBehindPlayer(playerid);
  return 1;
}

public OnPlayerSpawn(playerid)
{
  if( Recovering[playerid] )
  {
     //SetPlayerCameraPos(playerid, -2493.41, 645.15, 78.87);
     //SetPlayerCameraLookAt(playerid, -2498.31, 644.39, 78.19);
     return 1;
  }
  //normal spawn code
  return 1;
}
Might not need camera pos when player spawns, but if it doesn't work, try remove the // and see if it helps
Reply


Messages In This Thread
PAWN Lang Scripting Questions - by Torran - 29.04.2010, 19:16
Re: PAWN Lang Scripting Questions - by biltong - 29.04.2010, 19:48
Re: PAWN Lang Scripting Questions - by dice7 - 29.04.2010, 19:54
Re: PAWN Lang Scripting Questions - by coole210 - 29.04.2010, 19:59
Re: PAWN Lang Scripting Questions - by Torran - 29.04.2010, 20:08
Re: PAWN Lang Scripting Questions - by RyDeR` - 29.04.2010, 20:18
Re: PAWN Lang Scripting Questions - by Torran - 29.04.2010, 20:22
Re: PAWN Lang Scripting Questions - by Torran - 30.04.2010, 08:19
Re: PAWN Lang Scripting Questions - by Rac3r - 30.04.2010, 08:29
Re: PAWN Lang Scripting Questions - by Torran - 30.04.2010, 08:37

Forum Jump:


Users browsing this thread: 1 Guest(s)