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;
}
You have written "fall damage" not "fall death"
OnPlayerDeath is only for when player dies not for player damage... And if mean player death on fall then put this in OnPlayerDeath to see if it really called or not.. printf("[DEBUG] OnPlayerDeath Called || PlayerId : %i Reason ; %i", playerid, reason); |