14.12.2014, 05:47
As the title says, fall damage isnt calling the OnPlayerDeath function. I think it has something to do with OnPlayerTakeDamage, but I can't figure it out.
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
//Reseting hunger/thirst values.
pInfo[playerid][pHunger] = 100;
pInfo[playerid][pThirst] = 100;
UpdateBars(playerid);
KillTimer(TIMER_HUNGER[playerid]);
KillTimer(TIMER_THIRST[playerid]);
//Kills/deaths.
pInfo[killerid][pKills] ++;
pInfo[playerid][pDeaths] ++;
//Re-attaching their backpack.
TIMER_BACKPACKEQUIP[playerid] = SetTimerEx("BackpackEquip", 5000, false, "i", playerid);
PlayerSpawned[playerid] = false;
if(PlayerIsInLobby[playerid] == false && GameJoin == false ) //in a game.
{
PlayersLeft --; //Decrement by one.
new string[128];
format(string,sizeof(string), "%s has been eliminated from the Hunger Games. Players remaining: %d", GetName(playerid), PlayersLeft);
SCMA(COLOR_GREY, string);
if(PlayersLeft == 1) //If they are the last player remaining.
{
TIMER_WIN = SetTimer("WinRound", WIN_TIME, false);
return 1;
}
if(PlayersLeft == 0)
{
KillTimer(TIMER_WIN);
SCMA(COLOR_GREEN, "There are no remaining tributes to recieve a reward.");
TIMER_ENDTIMER = SetTimer("EndRound", 5000, false);
return 1;
}
}
return 1;
}
public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid)
{
if(PlayerIsInLobby[playerid] == true) //in lobby
{
if(TDMTeam[issuerid] == TDMTeam[playerid] && playerid != issuerid) return 0; //cant shoot team mates
}
return 1;
}