Death 255 - Please Help
#1

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.
Reply
#2

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

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
Reply
#4

Anyone?
Reply
#5

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


Forum Jump:


Users browsing this thread: 1 Guest(s)