22.07.2009, 19:17
This is how i would do it...
The above would work. but it would also spam the player in the area until they leave the area. aswell as removing 5hp every loop.
pawn Code:
forward CheckCube();
public CheckCube()
{
for(new i=0; i<MAX_PLAYERS; i++)
{
new Float:x, Float:y, Float:z;
GetPlayerPos(i, x, y, z)
if(IsPlayerAdmin(i))
return 0;
//if (x < MAX_X && x > MIN_X && y < MAX_Y && y > MIN_Y && z < MAX_Z && z > MIN_Z) example...
if ((x < 2077.4019 && x > 1998.5381 && y < 2142.5049 && y > 837.5109 && z < 2150.6023 && z > 852.4391)//Your admin zone
{
new Float:plhealth;
GetPlayerHealth(i, plhealth);
SetPlayerHealth(i, plhealth-5);//This will remove 5hp from the player every time the area is checked.
SendClientMessage(p,CZERWONY,"Jesteś na terytorium admina ! Wynoś się !!");
SetPlayerHealth(p,0);
}
}
return 1;
}