All pastes #800948 Raw Edit

Miscellany

public text v1 · immutable
#800948 ·published 2007-11-28 21:29 UTC
rendered paste body
public PenInArea()
{
	new Float:x, Float:y, Float:z;
		if(gPublicEnemy != 255)
		{
		if(!DmHiPlayer)
		{
			GetPlayerPos(gPublicEnemy, x, y, z);
			if(z>900.0)
			{
				new house = PlayerInfo[gPublicEnemy][pLocal];
				GameTextForPlayer(gPublicEnemy, "~w~There is nowhere to hide", 5000, 1);
				SetPlayerArmour(gPublicEnemy,0.0);
				SetPlayerHealth(gPublicEnemy, 10.0);
				SetPlayerInterior(gPublicEnemy,0);
				SetPlayerVirtualWorld(gPublicEnemy,0);//here it set your world back to 0
				PlayerInfo[gPublicEnemy][pInt] = 0;
				PlayerInfo[gPublicEnemy][pLocal] = 255;
				if(house > 99 && house != 255)
				{
					SetPlayerPos(gPublicEnemy, BizzInfo[house-99][bEntrancex], BizzInfo[house-99][bEntrancey],BizzInfo[house-99][bEntrancez]); // Warp the player
				}
				else if(house < 99 && house != 255)
				{
					SetPlayerPos(gPublicEnemy, HouseInfo[house][hEntrancex], HouseInfo[house][hEntrancey],HouseInfo[house][hEntrancez]); // Warp the player
				}
				else
				{
					SetPlayerPos(gPublicEnemy, 1350.1,-1279.1,13.3); // Warp the player to amunation
					SetPlayerHealth(gPublicEnemy,0.0);
				}
			}
			if(z <= -0.5)
			{
				GameTextForPlayer(gPublicEnemy, "~w~Public Enemy Can Not Swim", 5000, 1);
				SetPlayerHealth(gPublicEnemy,0.0);
			}
			if(x == PenPos[0] && y == PenPos[1] && z == PenPos[2])
			{
				for(new i = 0; i <= MAX_PLAYERS; i++)
				{
					if(IsPlayerConnected(i) && gTeam[i] == 2 && CrimInRange(5.0, gPublicEnemy,i))
					{
						SetPlayerHealth(gPublicEnemy, 0.0);
						OnPlayerDeath(gPublicEnemy, i, 0);
					}
				}
			}
			PenPos[0] = x ;PenPos[1]= y;PenPos[2]= z;
		}
		}
	return 1;
}