(ask)spawn player after death in hospital
#1

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

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

onplayerdeath

NeedHospital[playerid] = 1;

onplayerspawn

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

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

Use SetSpawnInfo after OnPlayerDeath

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


Forum Jump:


Users browsing this thread: 1 Guest(s)