04.05.2011, 18:08
Quote:
Hey, just wondering if someone can make this as I have no clue where to start:
Players loose 10 health every 20 seconds when they are in a certain area. Thanks in advance |
pawn Код:
//OnGameModeInit
SetTimer("AreaCheck", 20 * 1000, true);
pawn Код:
forward AreaCheck();
public AreaCheck()
{
for(new i, Float: health; i != MAX_PLAYERS; ++i) { //foreach if available
if(IsPlayerInRangeOfPoint(i, RADIUS, X, Y, Z)) { //insert radius and coords
//Checks if the player in in that circle
//You could use other function to
//Like IsPlayerInArea (checks if the player is in an axial sqaure)
//Or IsPlayerInPerimeter, checks if the player is in a perimeter
GetPlayerhealth(i, health);
SetPlayerHealth(i, health - 10);
}
}
}