Bump, and I got another question I added this hitman system on OnPlayerDeath:
Код:
printf("OnPlayerDeath: %d | %d | %d | %d", playerid, killerid, reason, AcceptedHit[playerid]);
// is called
Код:
if (AcceptedHit[playerid] == killerid && killerid != INVALID_PLAYER_ID && AcceptedHit[playerid] != 999)
{
printf("OnPlayerDeath: %d | %d | %d | %d", playerid, killerid, reason, AcceptedHit[playerid]); // Not getting called
new string[128];
for(new i = 1; i < MAX_FACTIONS; i++)
{
if(FactionData[i][fac_Taken] == 1 && FactionData[i][fac_Type] == FAC_TYPE_HITMEN)
{
format(string, sizeof(string),"Hitman %s has failed the contract on %s and lost $%d.", PlayerRPName(playerid), PlayerRPName(killerid), CharacterData[killerid][pBounty]/2);
SendFactionMessage(i, YELLOW, string);
}
}
format(string, sizeof(string),"You have killed a hitman and gained $%d, the contract on your head has been removed.", CharacterData[killerid][pBounty]/2);
SendClientMessage(killerid, YELLOW, string);
CharacterData[playerid][pFailedHits] ++;
PlayerJustDied[playerid] = 1;
GiveMoney(playerid, -CharacterData[killerid][pBounty]/2);
GiveMoney(killerid, CharacterData[killerid][pBounty]/2);
AcceptedHit[playerid] = 999;
CharacterData[killerid][pBounty] = 0;
printf("OnPlayerDeath: %d | %d | %d | %d", playerid, killerid, reason, AcceptedHit[playerid]);
return 1;
}
The code here above is blocking the rest from OnPlayerDeath, it blocks it somehow even though it shouldn't be even do something, debug:
Код:
OnPlayerDeath: 0 | 65535 | 255 | 999