SA-MP Forums Archive
Death 255 - Please Help - 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)
+--- Thread: Death 255 - Please Help (/showthread.php?tid=422526)



Death 255 - Please Help - Stephano - 14.03.2013

Alright, for some reason, I die every time I log into my server to test something. I don't know what's causing it, but in the server log, it says "[death] Joshua_Cather died 255" I tried setting up so that if that's the reason I die, I have it reset some stats and spawns you at a certain place, depending on the race you are. How do I fix it so that I don't die in the first place?

pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    if(reason == 255)
    {
        if(Player[playerid][Race] == 1)
        {
            SetPlayerPos(playerid,468.8824, 881.1055, -29.1138);
            Player[playerid][Health] = 100;
            Player[playerid][Hunger] = 100;
            Player[playerid][Thirst] = 100;
            Player[playerid][Radiation] = 9;
        }
        else if(Player[playerid][Race] == 2)
        {
            SetPlayerPos(playerid, 214.7090, 1902.7179, 17.6406);
            Player[playerid][Health] = 100;
            Player[playerid][Hunger] = 100;
            Player[playerid][Thirst] = 100;
            Player[playerid][Radiation] = 9;
        }
        else if(Player[playerid][Race] == 3)
        {
            SetPlayerPos(playerid, 274.3081, 1412.3754, 10.4440);
            Player[playerid][Health] = 100;
            Player[playerid][Hunger] = 100;
            Player[playerid][Thirst] = 100;
            Player[playerid][Radiation] = 9;
        }
    }
   
    if(killerid != INVALID_PLAYER_ID)
    {
        Player[killerid][Kills]++;
        Player[playerid][Deaths]++;
    }
    else
    {
        Player[playerid][Deaths]++;
    }
    return 1;
}
This is all that's in my OnPlayerDeath. If anyone can help, it'd be greatly appreciated.


Re: Death 255 - Please Help - MP2 - 14.03.2013

Why are you using SetPlayerPos under OnPlayerDeath? It won't do anything. I assume this should be under OnPlayerSpawn.


Re: Death 255 - Please Help - Stephano - 14.03.2013

I probably don't need the SetPlayerPos, but this doesn't answer my problem. It happens every time I update the script and I can't find out why.

EDIT: If I don't have that reason thing there, I will keep dying unless I set my health via a command on my server. If you have any idea what this is, please help me


Re: Death 255 - Please Help - Stephano - 16.03.2013

Anyone?


Re: Death 255 - Please Help - Stephano - 17.03.2013

Nevermind, I found the line that caused it. L&A