[FilterScript] [FS] Gangs+Bounties+Properties+Worldtime+NO gamble+Pirate ship+bank
#8

well but i removed something, the player that kills doenst get the bounty 

here is it
Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    new playercash;
	new killedplayer[MAX_PLAYER_NAME];
	new string[256];
	
	playercash = GetPlayerMoney(playerid);
	
	if(killerid == INVALID_PLAYER_ID)
	{
        SendDeathMessage(INVALID_PLAYER_ID,playerid,reason);
	}
	 else
	{
    	SendDeathMessage(killerid,playerid,reason);
		SetPlayerScore(killerid,GetPlayerScore(killerid)+1);
		if(bounty[playerid] > 0 && (playerGang[killerid] == 0 || playerGang[playerid] != playerGang[killerid])) {
			GetPlayerName(playerid, killedplayer, sizeof(killedplayer));
			format(string, sizeof(string), "You earned a bounty of %d for killing %s.", bounty[playerid], killedplayer);
			SendClientMessage(killerid, COLOR_GREEN, string);

			GivePlayerMoney(killerid, bounty[playerid]);
			bounty[playerid] = 0;
		}
		if(playercash > 0)  {
			GivePlayerMoney(killerid, playercash);
		}
  	}
  	
  	if(playercash > 0)
  	{
	    ResetPlayerMoney(playerid);
    }
 	return 1;
}
Update the code without warnings thnx to c-middia and now gives the bounty to the killer
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)