Loop + Dialog question.
#7

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
Reply


Messages In This Thread
Loop + Dialog question. - by ikbenremco - 24.06.2014, 17:31
Re: Loop + Dialog question. - by Threshold - 25.06.2014, 04:30
Re: Loop + Dialog question. - by Faisal_khan - 25.06.2014, 06:33
Re: Loop + Dialog question. - by ikbenremco - 25.06.2014, 09:10
Re: Loop + Dialog question. - by RenovanZ - 25.06.2014, 09:22
Re: Loop + Dialog question. - by ikbenremco - 25.06.2014, 10:30
Re: Loop + Dialog question. - by ikbenremco - 25.06.2014, 20:22
Re: Loop + Dialog question. - by d3ll - 25.06.2014, 21:15
Re: Loop + Dialog question. - by ikbenremco - 26.06.2014, 07:12

Forum Jump:


Users browsing this thread: 1 Guest(s)