All pastes #820266 Raw Edit

Someone

public text v1 · immutable
·published 2007-12-17 13:09 UTC
rendered paste body
public OnPlayerDeath(playerid, killerid, reason) {

	SetPlayerWantedLevel(killerid,GetPlayerWantedLevel(killerid)+1); //Sets wanted stars +1 for every kill

	if(gTeam[playerid] == TEAM_Police) { //if the killed player is a Police
	SetPlayerWantedLevel(killerid,GetPlayerWantedLevel(killerid)+1); //Give him a extra star
	SendClientMessageToTeam(TEAM_Police,0xFFFFFFAA,"A Police has been killed by %s.");


	for( new i = 0; i < MAX_ZONES; i++ ) // Loops through all gang zones
	{
	    if(IsPlayerInArea( killerid, zones[i][zMinX],  zones[i][zMinY], zones[i][zMaxX], zones[i][zMaxY] )) //checks if the player is in this zone when he died
	    {
	      //  {
	        	if( zones[i][ZoneKills] == 0) // if the zone kills equals 0 then start the zone flashing and increment the kills by 1
				{
    				ShowAllZones(playerid);

	       	 	    GangZoneFlashForAll(zones[i][zoneID], FLASH_COLOR);

	       	 		zones[i][ZoneKills]++;
				}

				else if( zones[i][ZoneKills] == MAX_ZONE_KILLS ) // If the zone kills equals the max kills allowed to win zone. Stop the flashing
				{
					GangZoneStopFlashForAll( zones[i][zoneID]);
					GangZoneHideForAll( zones[i][zoneID]);
					GangZoneShowForAll(zones[i][zoneID], GetPlayerColor(killerid) ); // Sets the zones color to the killers
					zones[i][ZoneOwner] = killerid;
					zones[i][ZoneColor] = GetPlayerColor(killerid);
					zones[i][ZoneKills] = 0;
				}

				else {
				    ShowAllZones(playerid);
				    GangZoneFlashForAll(zones[i][zoneID] , FLASH_COLOR);
					zones[i][ZoneKills]++;
				}
			}
		}
	return 1;
}