How to if a player dies, spawns at hospital
#1

How can i do this, if a player dies, that he need to
wait 1 minute and then spawn at hospital.??
Reply
#2

make each city an 'area'

then put under onplayerdeath

if isplayerinarea

setplayerpos (hospital location)
Reply
#3

Quote:
Originally Posted by boelie
make each city an 'area'

then put under onplayerdeath

if isplayerinarea

setplayerpos (hospital location)
Thanks!!
Reply
#4

What he means is :
pawn Код:
new DIED[MAX_PLAYERS];

public OnPlayerSpawn(playerid)
{
 if(DIED[playerid] == 1)
  {
  SetPlayerPos(...)
  }
 return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
 DIED[playerid] = 1;
 return 1;
}
Reply
#5

Quote:
Originally Posted by ViruZZzZ_ChiLLL
What he means is :
pawn Код:
new DIED[MAX_PLAYERS];

public OnPlayerSpawn(playerid)
{
 if(DIED[playerid] == 1)
 {
  SetPlayerPos(...)
 }
 return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
 DIED[playerid] = 1;
 return 1;
}
Thanks :P But how can i do that the player needs to wait
60 second and sees on the screen how much seconds left?
Reply
#6

Quote:
Originally Posted by Ihsan_Cingisiz
How can i do this, if a player dies, that he need to
wait 1 minute and then spawn at hospital.??
you also need a timer
Reply
#7

Quote:
Originally Posted by boelie
Quote:
Originally Posted by Ihsan_Cingisiz
How can i do this, if a player dies, that he need to
wait 1 minute and then spawn at hospital.??
you also need a timer
pawn Код:
public OnPlayerSpawn(playerid)
{
 if(DEAD[playerid] == 1)
 {
  TogglePlayerControllable(playerid, 0);
  SetCameraPos(...) // looking at the hospital.
  SetPlayerCameraLookAt(....);
  SetTimer("DEAD1", 60000, true);
 }
 return 1;
}

forward DEAD1();
public DEAD1()
{
 TogglePlayerControllable(playerid, 1);
 return 1;
}
You have to use a TextDraw for the time remaining.
Reply
#8

Nice, im gonna use the function of timer in my server, thx bro.
Reply
#9

Quote:
Originally Posted by ViruZZzZ_ChiLLL
Quote:
Originally Posted by boelie
Quote:
Originally Posted by Ihsan_Cingisiz
How can i do this, if a player dies, that he need to
wait 1 minute and then spawn at hospital.??
you also need a timer
pawn Код:
public OnPlayerSpawn(playerid)
{
 if(DEAD[playerid] == 1)
 {
  TogglePlayerControllable(playerid, 0);
  SetCameraPos(...) // looking at the hospital.
  SetPlayerCameraLookAt(....);
  SetTimer("DEAD1", 60000, true);
 }
 return 1;
}

forward DEAD1();
public DEAD1()
{
 TogglePlayerControllable(playerid, 1);
 return 1;
}
You have to use a TextDraw for the time remaining.
Doesnt work :S
Can you please make the positions for me?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)