Respawn Time
#1

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
Reply
#2

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

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"?
Reply
#4

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

In this case, you would spawn the player.
Reply
#5

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);
}
Reply
#6

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?
Reply
#7

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;
}
Reply
#8

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?
Reply
#9

Yes. Only when you die.
Reply
#10

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?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)