Instant Respawn After Death
#1

So guys, in order to make a fast respawn system, i just put a SpawnPlayer ot OnPlayerDeath.

The problem is that the player just die right after respawn

https://www.youtube.com/watch?v=fCor52uV-Ps

Can you guys help me? Thanks
Reply
#2

Seems like an issue with your code!

Try this?
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    SpawnPlayer(playerid);
    SetPlayerPos(playerid, // their position, or whatever
    SetPlayerHealth(playerid, 100.0);
    return true;
}
If this works then it is an issue with your code, and moreso not a SA:MP bug!(which it's not!).

Unless you want to show your code, we can't really fix it.
Reply
#3

better than the above try this:

OnPlayerDeath:
pawn Код:
SpawnPlayer(playerid);
Reply
#4

@Eth
Quote:
Originally Posted by arakuta
Посмотреть сообщение
So guys, in order to make a fast respawn system, i just put a SpawnPlayer ot OnPlayerDeath.

The problem is that the player just die right after respawn

https://www.youtube.com/watch?v=fCor52uV-Ps

Can you guys help me? Thanks
Reply
#5

Try this:
pawn Код:
public OnPlayerDeath(playerid,killerid,reason)
{
    TogglePlayerSpectating(playerid, 1); //toggles them into spectation mode.
    TogglePlayerSpectating(playerid, 0); //ends spectation mode, calling OnPlayerSpawn.
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)