On Player Death shows Spawn button
#1

I made a Hospitalized system, when you die you spawn in the hospital and have to stay there for 5 mins.
But when I die it shows the spawn buttons...
What did I do wrong?

pawn Code:
public OnPlayerDeath(playerid, killerid, reason)
{
    FadeColorForPlayer(playerid,255,0,0,0,255,0,0,255,25,1000);
    JustDied[playerid]=1;
    switch(reason)
    {
        case 0:
        {
            SendClientMessage(playerid, COLOR_ORANGE, ". : : All Saints General Hospital : : .");
            SendClientMessage(playerid, SERVERCOLOR, "You have been beaten unconsious!");
            SendClientMessage(playerid, SERVERCOLOR, "You are now in the All Saints General Hospital to rest!");
            Player[playerid][Hospitalized] = 300;
            SetSpawnInfo(playerid, 0, 62,-198.6134,-1790.6299,675.7859,351.7826,0,0,0,0,0,0);
            SpawnPlayer(playerid);
            SetPlayerInterior(playerid, 3);
            SetPlayerVirtualWorld(playerid, 3);
        }
        case 51:
        {
            SendClientMessage(playerid, COLOR_ORANGE, ". : : All Saints General Hospital : : .");
            SendClientMessage(playerid, SERVERCOLOR, "You have been in flames!");
            SendClientMessage(playerid, SERVERCOLOR, "Docters are curing your burn wounds!");
            SendClientMessage(playerid, SERVERCOLOR, "You are now in the All Saints General Hospital to rest!");
            Player[playerid][Hospitalized] = 300;
            SetSpawnInfo(playerid, 0, 62,-201.6592,-1788.9675,675.7859,88.7250,0,0,0,0,0,0);
            SpawnPlayer(playerid);
            SetPlayerInterior(playerid, 3);
            SetPlayerVirtualWorld(playerid, 3);
        }
        case 53:
        {
            SendClientMessage(playerid, COLOR_ORANGE, ". : : All Saints General Hospital : : .");
            SendClientMessage(playerid, SERVERCOLOR, "You have been drowned!");
            SendClientMessage(playerid, SERVERCOLOR, "Docters are pumping the water out of your lungs!");
            SendClientMessage(playerid, SERVERCOLOR, "You are now in the All Saints General Hospital to rest!");
            Player[playerid][Hospitalized] = 300;
            SetSpawnInfo(playerid, 0, 62,-201.6592,-1788.9675,675.7859,88.7250,0,0,0,0,0,0);
            SpawnPlayer(playerid);
            SetPlayerInterior(playerid, 3);
            SetPlayerVirtualWorld(playerid, 3);
        }
        case 54:
        {
            SendClientMessage(playerid, COLOR_ORANGE, ". : : All Saints General Hospital : : .");
            SendClientMessage(playerid, SERVERCOLOR, "You have felt from a very high hight!");
            SendClientMessage(playerid, SERVERCOLOR, "Docters are repairing your backbone!");
            SendClientMessage(playerid, SERVERCOLOR, "You are now in the All Saints General Hospital to rest!");
            Player[playerid][Hospitalized] = 300;
            SetSpawnInfo(playerid, 0, 62,-201.6592,-1788.9675,675.7859,88.7250,0,0,0,0,0,0);
            SpawnPlayer(playerid);
            SetPlayerInterior(playerid, 3);
            SetPlayerVirtualWorld(playerid, 3);
        }
        case 50,49:
        {
            SendClientMessage(playerid, COLOR_ORANGE, ". : : All Saints General Hospital : : .");
            SendClientMessage(playerid, SERVERCOLOR, "You have been hit by a vehicle!");
            SendClientMessage(playerid, SERVERCOLOR, "Docters are repairing your backbone!");
            SendClientMessage(playerid, SERVERCOLOR, "You are now in the All Saints General Hospital to rest!");
            Player[playerid][Hospitalized] = 300;
            SetSpawnInfo(playerid, 0, 62,-201.6592,-1788.9675,675.7859,88.7250,0,0,0,0,0,0);
            SpawnPlayer(playerid);
            SetPlayerInterior(playerid, 3);
            SetPlayerVirtualWorld(playerid, 3);
        }
        case 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15:
        {
            SendClientMessage(playerid, COLOR_ORANGE, ". : : All Saints General Hospital : : .");
            SendClientMessage(playerid, SERVERCOLOR, "You have been stabbed!");
            SendClientMessage(playerid, SERVERCOLOR, "Docters are cleaning your wounds!");
            SendClientMessage(playerid, SERVERCOLOR, "You are now in the All Saints General Hospital to rest!");
            Player[playerid][Hospitalized] = 300;
            SetSpawnInfo(playerid, 0, 62,-211.9630,-1761.9679,675.7687,309.1454,0,0,0,0,0,0);
            SpawnPlayer(playerid);
            SetPlayerInterior(playerid, 3);
            SetPlayerVirtualWorld(playerid, 3);
        }
        case 16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40:
        {
            SendClientMessage(playerid, COLOR_ORANGE, ". : : All Saints General Hospital : : .");
            SendClientMessage(playerid, SERVERCOLOR, "You have been shot!");
            SendClientMessage(playerid, SERVERCOLOR, "Docters are removing the bullets!");
            SendClientMessage(playerid, SERVERCOLOR, "You are now in the All Saints General Hospital to rest!");
            Player[playerid][Hospitalized] = 300;
            SetSpawnInfo(playerid, 0, 62,-211.9630,-1761.9679,675.7687,309.1454,0,0,0,0,0,0);
            SpawnPlayer(playerid);
            SetPlayerInterior(playerid, 3);
            SetPlayerVirtualWorld(playerid, 3);
        }
    }
    return 1;
}
Reply
#2

What do you mean spawn buttons?
Reply
#3

When I die it shows:

<<< >>> Spawn
Reply
#4

This is what setspawninfo function does and spawn function doesnt work on class selection. Instead of using the setspawninfo, use some "if" under onplayerspawn like if hospitalcase[playerid]=0/1/2 and settle there their spawning infos.
Reply
#5

pawn Code:
public OnPlayerDeath(playerid, killerid, reason)
{
    FadeColorForPlayer(playerid,255,0,0,0,255,0,0,255,25,1000);
    JustDied[playerid]=1;
    switch(reason)
    {
        case 0:
        {
            JustDiedCase[playerid] = 1;
        }
        case 51:
        {
            JustDiedCase[playerid] = 2;
        }
        case 53:
        {
            JustDiedCase[playerid] = 3;
        }
        case 54:
        {
            JustDiedCase[playerid] = 4;
        }
        case 50,49:
        {
            JustDiedCase[playerid] = 5;
        }
        case 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15:
        {
            JustDiedCase[playerid] = 6;
        }
        case 16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40:
        {
            JustDiedCase[playerid] = 7;
        }
    }
    return 1;
}
pawn Code:
if(JustDied[playerid])
    {
        FadeColorForPlayer(playerid,255,0,0,255,255,0,0,0,25,0);
        JustDied[playerid]=0;
        switch(JustDiedCase[playerid])
        {
            case 1:
            {
                SendClientMessage(playerid, COLOR_ORANGE, ". : : All Saints General Hospital : : .");
                SendClientMessage(playerid, SERVERCOLOR, "You have been beaten unconsious!");
                SendClientMessage(playerid, SERVERCOLOR, "You are now in the All Saints General Hospital to rest!");
                Player[playerid][Hospitalized] = 300;
                SetSpawnInfo(playerid, 0, 62,-198.6134,-1790.6299,675.7859,351.7826,0,0,0,0,0,0);
                SpawnPlayer(playerid);
                SetPlayerInterior(playerid, 3);
                SetPlayerVirtualWorld(playerid, 3);
            }
            case 2:
            {
                SendClientMessage(playerid, COLOR_ORANGE, ". : : All Saints General Hospital : : .");
                SendClientMessage(playerid, SERVERCOLOR, "You have been in flames!");
                SendClientMessage(playerid, SERVERCOLOR, "Docters are curing your burn wounds!");
                SendClientMessage(playerid, SERVERCOLOR, "You are now in the All Saints General Hospital to rest!");
                Player[playerid][Hospitalized] = 300;
                SetSpawnInfo(playerid, 0, 62,-201.6592,-1788.9675,675.7859,88.7250,0,0,0,0,0,0);
                SpawnPlayer(playerid);
                SetPlayerInterior(playerid, 3);
                SetPlayerVirtualWorld(playerid, 3);
            }
            case 3:
            {
                SendClientMessage(playerid, COLOR_ORANGE, ". : : All Saints General Hospital : : .");
                SendClientMessage(playerid, SERVERCOLOR, "You have been drowned!");
                SendClientMessage(playerid, SERVERCOLOR, "Docters are pumping the water out of your lungs!");
                SendClientMessage(playerid, SERVERCOLOR, "You are now in the All Saints General Hospital to rest!");
                Player[playerid][Hospitalized] = 300;
                SetSpawnInfo(playerid, 0, 62,-201.6592,-1788.9675,675.7859,88.7250,0,0,0,0,0,0);
                SpawnPlayer(playerid);
                SetPlayerInterior(playerid, 3);
                SetPlayerVirtualWorld(playerid, 3);
            }
            case 4:
            {
                SendClientMessage(playerid, COLOR_ORANGE, ". : : All Saints General Hospital : : .");
                SendClientMessage(playerid, SERVERCOLOR, "You have felt from a very high hight!");
                SendClientMessage(playerid, SERVERCOLOR, "Docters are repairing your backbone!");
                SendClientMessage(playerid, SERVERCOLOR, "You are now in the All Saints General Hospital to rest!");
                Player[playerid][Hospitalized] = 300;
                SetSpawnInfo(playerid, 0, 62,-201.6592,-1788.9675,675.7859,88.7250,0,0,0,0,0,0);
                SpawnPlayer(playerid);
                SetPlayerInterior(playerid, 3);
                SetPlayerVirtualWorld(playerid, 3);
            }
            case 5:
            {
                SendClientMessage(playerid, COLOR_ORANGE, ". : : All Saints General Hospital : : .");
                SendClientMessage(playerid, SERVERCOLOR, "You have been hit by a vehicle!");
                SendClientMessage(playerid, SERVERCOLOR, "Docters are repairing your backbone!");
                SendClientMessage(playerid, SERVERCOLOR, "You are now in the All Saints General Hospital to rest!");
                Player[playerid][Hospitalized] = 300;
                SetSpawnInfo(playerid, 0, 62,-201.6592,-1788.9675,675.7859,88.7250,0,0,0,0,0,0);
                SpawnPlayer(playerid);
                SetPlayerInterior(playerid, 3);
                SetPlayerVirtualWorld(playerid, 3);
            }
            case 6:
            {
                SendClientMessage(playerid, COLOR_ORANGE, ". : : All Saints General Hospital : : .");
                SendClientMessage(playerid, SERVERCOLOR, "You have been stabbed!");
                SendClientMessage(playerid, SERVERCOLOR, "Docters are cleaning your wounds!");
                SendClientMessage(playerid, SERVERCOLOR, "You are now in the All Saints General Hospital to rest!");
                Player[playerid][Hospitalized] = 300;
                SetSpawnInfo(playerid, 0, 62,-211.9630,-1761.9679,675.7687,309.1454,0,0,0,0,0,0);
                SpawnPlayer(playerid);
                SetPlayerInterior(playerid, 3);
                SetPlayerVirtualWorld(playerid, 3);
            }
            case 7:
            {
                SendClientMessage(playerid, COLOR_ORANGE, ". : : All Saints General Hospital : : .");
                SendClientMessage(playerid, SERVERCOLOR, "You have been shot!");
                SendClientMessage(playerid, SERVERCOLOR, "Docters are removing the bullets!");
                SendClientMessage(playerid, SERVERCOLOR, "You are now in the All Saints General Hospital to rest!");
                Player[playerid][Hospitalized] = 300;
                SetSpawnInfo(playerid, 0, 62,-211.9630,-1761.9679,675.7687,309.1454,0,0,0,0,0,0);
                SpawnPlayer(playerid);
                SetPlayerInterior(playerid, 3);
                SetPlayerVirtualWorld(playerid, 3);
            }
        }
    }
Reply
#6

pawn Code:
public OnPlayerSpawn(playerid)
{
    if(JustDied[playerid]>0)
    {
        FadeColorForPlayer(playerid,255,0,0,255,255,0,0,0,25,0);
        switch(JustDiedCase[playerid])
        {
            case 1:
            {
                SendClientMessage(playerid, COLOR_ORANGE, ". : : All Saints General Hospital : : .");
                SendClientMessage(playerid, SERVERCOLOR, "You have been beaten unconsious!");
                SendClientMessage(playerid, SERVERCOLOR, "You are now in the All Saints General Hospital to rest!");
                Player[playerid][Hospitalized] = 300;
                SetPlayerPos(playerid, --198.6134,-1790.6299,675.7859);
                SetPlayerFacingAngle(playerid, 351.7826);
                SetPlayerSkin(playerid, 62);
                SetPlayerInterior(playerid, 3);
                SetPlayerVirtualWorld(playerid, 3);
            }
            case 2:
            {
                SendClientMessage(playerid, COLOR_ORANGE, ". : : All Saints General Hospital : : .");
                SendClientMessage(playerid, SERVERCOLOR, "You have been in flames!");
                SendClientMessage(playerid, SERVERCOLOR, "Docters are curing your burn wounds!");
                SendClientMessage(playerid, SERVERCOLOR, "You are now in the All Saints General Hospital to rest!");
                Player[playerid][Hospitalized] = 300;
                SetPlayerPos(playerid, -201.6592,-1788.9675,675.7859);
                SetPlayerFacingAngle(playerid, 88.725);
                SetPlayerSkin(playerid, 62);
                SetPlayerInterior(playerid, 3);
                SetPlayerVirtualWorld(playerid, 3);
            }
            case 3:
            {
            .....
Reply
#7

Still not working...
Reply
#8

What's the problem this time?
Reply
#9

It stucks on
pawn Code:
public OnPlayerDeath(playerid, killerid, reason)
{
    FadeColorForPlayer(playerid,255,0,0,0,255,0,0,255,25,1000);
    JustDied[playerid]=1;
    Player[playerid][Hospitalized] = 300;
    switch(reason)
    {
        case 0:
        {
            JustDiedCase[playerid] = 1;
        }
        case 51:
        {
            JustDiedCase[playerid] = 2;
        }
        case 53:
        {
            JustDiedCase[playerid] = 3;
        }
        case 54:
        {
            JustDiedCase[playerid] = 4;
        }
        case 50,49:
        {
            JustDiedCase[playerid] = 5;
        }
        case 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15:
        {
            JustDiedCase[playerid] = 6;
        }
        case 16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40:
        {
            JustDiedCase[playerid] = 7;
        }
    }
    //SpawnPlayer(playerid);
    return 1;
}
I think... It doesn't continue
Reply
#10

Are you sure you wrote down what I gave you above?
Quote:
Originally Posted by HurtLocker
View Post
pawn Code:
public OnPlayerSpawn(playerid)
{
    if(JustDied[playerid]>0)
    {
        FadeColorForPlayer(playerid,255,0,0,255,255,0,0,0,25,0);
        switch(JustDiedCase[playerid])
        {
            case 1:
            {
                SendClientMessage(playerid, COLOR_ORANGE, ". : : All Saints General Hospital : : .");
                SendClientMessage(playerid, SERVERCOLOR, "You have been beaten unconsious!");
                SendClientMessage(playerid, SERVERCOLOR, "You are now in the All Saints General Hospital to rest!");
                Player[playerid][Hospitalized] = 300;
                SetPlayerPos(playerid, --198.6134,-1790.6299,675.7859);
                SetPlayerFacingAngle(playerid, 351.7826);
                SetPlayerSkin(playerid, 62);
                SetPlayerInterior(playerid, 3);
                SetPlayerVirtualWorld(playerid, 3);
            }
            case 2:
            {
                SendClientMessage(playerid, COLOR_ORANGE, ". : : All Saints General Hospital : : .");
                SendClientMessage(playerid, SERVERCOLOR, "You have been in flames!");
                SendClientMessage(playerid, SERVERCOLOR, "Docters are curing your burn wounds!");
                SendClientMessage(playerid, SERVERCOLOR, "You are now in the All Saints General Hospital to rest!");
                Player[playerid][Hospitalized] = 300;
                SetPlayerPos(playerid, -201.6592,-1788.9675,675.7859);
                SetPlayerFacingAngle(playerid, 88.725);
                SetPlayerSkin(playerid, 62);
                SetPlayerInterior(playerid, 3);
                SetPlayerVirtualWorld(playerid, 3);
            }
            case 3:
            {
            .....
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)