Onplayerdeath help
#1

what wrong with this
when i was a cops , and i killed a player that have wanted level , but still return to:
Код:
	if(GetPlayerTeam(killerid) == TEAM_Cops)
	{
	  	if(GetPlayerWantedLevel(playerid) <= 0)
		{
	        SetPlayerScore(killerid, GetPlayerScore(killerid)-5);
	        SendClientMessage(killerid, COLOR_LIGHTBLUE,"[POLICE]:{FFFFFF}You kill an innocent.You have -$5,000 and -5 score for punishment.");
	        GivePlayerMoney(killerid, -5000);
	    	GivePlayerMoney(playerid,-1000);
	    	return 1;
		}
	 	return 1;
	}
full code:
Код:
public OnPlayerDeath(playerid, killerid, reason)
{
	SendDeathMessage(killerid, playerid, reason);
	SetPlayerWantedLevel(playerid,0);
 	if(civ[killerid] == TEAM_Civ)
	{
	    SetPlayerScore(killerid,GetPlayerScore(killerid)+2);
	    SetPlayerWantedLevel(killerid, GetPlayerWantedLevel(killerid) +12);
		GivePlayerMoney(playerid,-1000);
		return 1;
	}
	if(civ[killerid] == TEAM_FireMan)
	{
	    SetPlayerScore(killerid,GetPlayerScore(killerid)+2);
	    SetPlayerWantedLevel(killerid, GetPlayerWantedLevel(killerid) +12);
		GivePlayerMoney(playerid,-1000);
		return 1;
	}
	if(GetPlayerTeam(killerid) == TEAM_Cops)
	{
	  	if(GetPlayerWantedLevel(playerid) <= 0)
		{
	        SetPlayerScore(killerid, GetPlayerScore(killerid)-5);
	        SendClientMessage(killerid, COLOR_LIGHTBLUE,"[POLICE]:{FFFFFF}You kill an innocent.You have -$5,000 and -5 score for punishment.");
	        GivePlayerMoney(killerid, -5000);
	    	GivePlayerMoney(playerid,-1000);
	    	return 1;
		}
	 	return 1;
	}
	if(GetPlayerTeam(killerid) == TEAM_Cops)
	{
		if(GetPlayerWantedLevel(playerid) >= 1 )
		{
			new string200[200];
			new money = GetPlayerWantedLevel(playerid)*100;
			format(string200, sizeof(string200), "[POLICE]:{FFFFFF}%s(%d) has been taken down by %s(%d) with %i wanted level and earn $%s.",GetPlayerName(playerid),playerid,GetPlayerName(killerid),killerid,GetPlayerWantedLevel(playerid),Comma(money));
			SendClientMessageToAll(COLOR_BLUE,string200);
			SetPlayerScore(killerid, GetPlayerScore(killerid)+2);
			GivePlayerMoney(killerid,money);
	    	GivePlayerMoney(playerid,-1000);
	    	return 1;
		}
		return 1;
	}
}
Reply


Messages In This Thread
Onplayerdeath help - by JawsPlus - 17.12.2014, 06:38
Re: Onplayerdeath help - by Haz - 17.12.2014, 07:22
Re: Onplayerdeath help - by JawsPlus - 17.12.2014, 08:05
Re: Onplayerdeath help - by JawsPlus - 17.12.2014, 12:06

Forum Jump:


Users browsing this thread: 1 Guest(s)