SA-MP Forums Archive
death player - 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: death player (/showthread.php?tid=147380)



death player - remyguys - 11.05.2010

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!



Re: death player - Conroy - 11.05.2010

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;
}




Re: death player - Faith - 11.05.2010

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
}..


Re: death player - Conroy - 11.05.2010

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


Re: death player - Faith - 11.05.2010

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!


Re: death player - aircombat - 11.05.2010

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


Re: death player - Conroy - 11.05.2010

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;
}




Re: death player - remyguys - 11.05.2010

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?



Re: death player - Killa_ - 11.05.2010

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



Re: death player - Conroy - 11.05.2010

My bad. >.<