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
#2

add under GivePlayerMoney(killerid, true);
Reply
#3

Not working got other solution
Reply
#4

Can anybody help me
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)