SA-MP Forums Archive
(ask)spawn player after death in hospital - 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: (ask)spawn player after death in hospital (/showthread.php?tid=162651)



(ask)spawn player after death in hospital - gondes - 24.07.2010

Guys I need script for spwan player death after in front of hospital


Re: (ask)spawn player after death in hospital - Kitten - 24.07.2010

Code:
public OnPlayerDeath(playerid, killerid, reason)
{
        SetPlayerPos(.....CO-RD...);
	return 1;
}



Re: (ask)spawn player after death in hospital - ikey07 - 24.07.2010

onplayerdeath

NeedHospital[playerid] = 1;

onplayerspawn

If(NeedHospital[playerid] == 1)
{
SetPlayerPos(...
NeedHospital[playerid] = 0;
}


Re: (ask)spawn player after death in hospital - Jakku - 24.07.2010

Quote:
Originally Posted by Kitten
View Post
Code:
public OnPlayerDeath(playerid, killerid, reason)
{
        SetPlayerPos(.....CO-RD...);
	return 1;
}
Does not work. You are not setting it after death. It should be set after spawn.

So:

pawn Code:
new Dead[MAX_PLAYERS];

public OnPlayerDeath(playerid,killerid, reason)
{
Dead[playerid] = 1;
return 1;
}

public OnPlayerSpawn(playerid)
{
if (Dead[playerid] == 1) {
SetPlayerPos(playerid, X,Y,Z);'
Dead[playerid] = 0;
}

return 1;
}



Re: (ask)spawn player after death in hospital - sabretur - 07.05.2011

Use SetSpawnInfo after OnPlayerDeath

https://sampwiki.blast.hk/wiki/SetSpawnInfo