14.03.2013, 02:55
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?
This is all that's in my OnPlayerDeath. If anyone can help, it'd be greatly appreciated.
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;
}