Help to make people respawn at hospital after death
#10

Quote:
Originally Posted by FreddoX [BINMAN
]
What he means is, when they die set the variable and check it OnPlayerSpawn(), if the variable is equal to 1 or something, set their position to hospital, etc.

pawn Код:
new Hospitalized[ MAX_PLAYERS ];

public OnPlayerConnect( playerid )
{
Hospitalized[ playerid ] = 0; // Just so people don't login inside hospital because the variable doesn't unset on disconnect.
return 1;
}

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

public OnPlayerSpawn( playerid )
{
if( Hospitalized[ playerid ] == 1 )
{
// SetPlayerPos etc.
}
else
{
// Do whatever, they're not hospitalized.
}
return 1;
}
Whenever I add the last code with SetPlayerPos and the 'Do whatever, they're not hospitalized.' I'm just adding GetPlayerIp because I thought like I had to get something to see if it then would make it work, so I did. But it still doesn't work, well I don't know if it does everytime I add the last part which is at OnPlayerSpawn, then when I'm compiling it says 'Pawno has stopped working' or something, I have no idea how to fix this, but if I delete the code, then it compiles with just 1 warning with an unreachable code.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)