death player
#1

I need the lines for if you die you go somewhere(coords can be chosen by me) for like 10 minutes.
After those 10 minutes you spawn on the coords what i chose and you can continue playing.

Anyone know how to do that?

Thanks in Advance!
Reply
#2

pawn Код:
forward DeathTimer(id);
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
SetPlayerPos(playerid, X, Y, Z);
SetTimerEx("DeathTimer", 600000, false, "i", playerid);
return 1;
}
pawn Код:
public DeathTimer(id)
{
SetPlayerPos(id, X, Y, Z);
return 1;
}

Reply
#3

nevermind... misread your question


Btw, Conroy.

Doesnt the setplayerpos needs to be onplayerspawn?


In that case, he needs to make a new playerdeath[max_players];

onplayerdeath
playerdeath=1

onplayerspawn
if(playerdeath=1) {
setplayerpos
}..
Reply
#4

Nope, SetPlayerPos can be used in any function that supports playerid.
Reply
#5

Yea, but i was just thinking that he gets teleported onplayerdeath to this location.
and a little second later, he then spawns at normal spawn - etc at hospital or something.


But i can be wrong!
Reply
#6

conroy it wouldn't work it should be on onplayerspawn and make a variable to save if player is dead
Reply
#7

Ahh, I get you now. Here, use this:

pawn Код:
forward DeathTimer(id);

new PlayerDeath[MAX_PLAYERS];
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
PlayerDeath[playerid] = 1;
SetTimerEx("DeathTimer", 600000, false, "i", playerid);
return 1;
}
pawn Код:
public OnPlayerSpawn(playerid)
{
if(PlayerDeath[playerid] = 1) SetPlayerPos(playerid, X, Y, Z);
return 1;
}
pawn Код:
public DeathTimer(id)
{
SetPlayerPos(id, X, Y, Z);
PlayerDeath[id] = 0;
return 1;
}

Reply
#8

i get these errors

C:\Users\Remy\Downloads\samp03asvr_R7_win32\gamemo des\lscrp.pwn(260 : error 010: invalid function or declaration
C:\Users\Remy\Downloads\samp03asvr_R7_win32\gamemo des\lscrp.pwn(2609) : error 010: invalid function or declaration

Lines :

2608 : if(PlayerDeath[playerid] = 1) SetPlayerPos(playerid, X, Y, Z);
2609 : return 1;

Any idea?
Reply
#9

pawn Код:
if(PlayerDeath[playerid] == 1) SetPlayerPos(playerid, X, Y, Z);
Reply
#10

My bad. >.<
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)