SA-MP Forums Archive
Respawn Time - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Respawn Time (/showthread.php?tid=86805)



Respawn Time - Illex - 16.07.2009

Hello folks!
I have a question:
I want you when you die not immediately spawnt.
This is very probably under "OnPlayerDeath".
I would like to have a
Код:
SetPlayerCameraLookAt(playerid,   X    ,   Y   ,  Z  );
interrogation. On your screen should be write, after which time you'll respawn and the seconds should be countdown to zero.
Then, when the time expires I want you to spawn at coordinate X, Y, Z.
The important thing is that when one first enters the server, not the time have to wait and then at the hospital spawn instead of his Ganghq.

Is that possible?

Sorry for my bad english, I'm from Germany.

Yours sincerely,
Illex


Re: Respawn Time - MenaceX^ - 16.07.2009

OnPlayerDeath you should set the camera.
Then set a timer for how long you want, to disable the camera.


Re: Respawn Time - Illex - 16.07.2009

Okay, I make an example:
Код:
forward Respawntimer();
Код:
OnGameModeInit
{ 
 SetTimer("Respawntimer", 50000, 1)
Код:
public OnPlayerDeath
{
  SetCamerLookAt(playerid, 1234567, 1234567, 1234567)
Код:
public Respawntimer()
{
  	???
	return 1;
}
What I have to do under "public Respwantimer"?


Re: Respawn Time - kc - 16.07.2009

You would do what you want to happen when the time is up.

In this case, you would spawn the player.


Re: Respawn Time - MenaceX^ - 16.07.2009

kc. He doesn't have to.

Though I think you should do SetTimerEx because you need it for a specific player.
pawn Код:
public Respawntimer(playerid)
{
  // Send a message or something.
  SetCameraBehindPlayer(playerid);
}



Re: Respawn Time - Illex - 16.07.2009

So I make
Код:
public Respawntimer()
{
  	SetPlayerPos(playerid, 1234567, 1234567, 1234567)
    SetPlayerFacingAngle(playerid, 90.0000)
    SetCameraBehindPlayer(playerid)
	return 1;
}
?

Код:
public OnPlayerDeath
{
  SetCamerLookAt(playerid, 1234567, 1234567, 1234567);
  SetTimer("Respawntimer", 50000, 1)
  GameTextForPlayer(playerid, COLOR_RED, "you'll respawn in 5 minutes,"
Then it works?


Re: Respawn Time - kc - 16.07.2009

As MenaceX^ said, you will need to use SetTimerEx to use the playerid variable.

pawn Код:
forward Respawntimer(playerid);
pawn Код:
public OnPlayerDeath(playerid,killerid,reason)
{
  SetCamerLookAt(playerid, 1234567.0, 1234567.0, 1234567.0);
  SetTimerEx("Respawntimer", 300000, 0, "i", playerid);
  GameTextForPlayer(playerid, COLOR_RED, "you'll respawn in 5 minutes", 5000, 4);
  //Other stuff in OnPlayerDeath
  return 1;
}
pawn Код:
public Respawntimer(playerid)
{
  SetPlayerPos(playerid, 1234567, 1234567, 1234567);
  SetPlayerFacingAngle(playerid, 90.0000);
  SetCameraBehindPlayer(playerid)
  return 1;
}



Re: Respawn Time - Illex - 16.07.2009

Quote:
Originally Posted by kc
As MenaceX^ said, you will need to use SetTimerEx to use the playerid variable.

pawn Код:
forward Respawntimer(playerid);
pawn Код:
public OnPlayerDeath(playerid,killerid,reason)
{
  SetCamerLookAt(playerid, 1234567.0, 1234567.0, 1234567.0);
  SetTimerEx("Respawntimer", 300000, 0, "i", playerid);
  GameTextForPlayer(playerid, COLOR_RED, "you'll respawn in 5 minutes", 5000, 4);
  //Other stuff in OnPlayerDeath
  return 1;
}
pawn Код:
public Respawntimer(playerid)
{
  SetPlayerPos(playerid, 1234567, 1234567, 1234567);
  SetPlayerFacingAngle(playerid, 90.0000);
  SetCameraBehindPlayer(playerid)
  return 1;
}
okay, so you don't have to wait if you enter the server?
Only when you really die?


Re: Respawn Time - kc - 16.07.2009

Yes. Only when you die.


Re: Respawn Time - Illex - 16.07.2009

I noticed one error:
Код:
(29294) : error 025: function heading differs from prototype
29294 = public Respawntimer(playerid)

my forward is:
Код:
forward Respawntimer();
is there the mistake?