05.01.2013, 11:36
Pu this at the bottom of your script
Now get the coordination of that area there are a lot of tutorials for that, after you get done with that use
OnPlayerUpdate to check if he is in the area
Put this in a timer or in OnplayerUpdate.
pawn Код:
IsPlayerInArea(playerid, Float:MinX, Float:MinY, Float:MaxX, Float:MaxY)
{
new Float:X, Float:Y, Float:Z;
GetPlayerPos(playerid, X, Y, Z);
if(X >= MinX && X <= MaxX && Y >= MinY && Y <= MaxY) {
return 1;
}
return 0;
}
OnPlayerUpdate to check if he is in the area
Put this in a timer or in OnplayerUpdate.
pawn Код:
if(IsPlayerInArea(playerid,MaxX,MaxY,MinX,MinY)&& !=IsPlayerAdmin(playerid))//change the MaxX,MaxY,MinX,MinY to the real cords
{//This will only allow Rcon admin to get into the area, if you have an admin system, change IsPlayerAdmin
SetPlayerHealth(playerid,0);//Kills the player
SendClientMessage(playerid,-1,"this area is only for admins);//bla bla
return 1;
}