21.11.2010, 15:08
Try this
pawn Код:
#include <a_samp>
forward CheckPInArea(playerid);
public CheckPInArea(playerid)
{
if(IsPlayerInArea(playerid, 896.5746, 2057.332, 978.5764, 2184.978) && !IsPlayerAdmin(playerid)){ //X, Y, Z
//Get & SetPlayerWanted
SetPlayerWantedLevel( playerid, (GetPlayerWantedLevel( playerid ) + 10) );
new wantedlevel;
wantedlevel = GetPlayerWantedLevel(playerid);
new tmp[64];
//GetPlayerName
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
//TextToShow
format(tmp, sizeof(tmp), "(TRASPASSING) %s is traspassing ARMY, his/her wanted level is now: %i", wantedlevel);
SendClientMessage(playerid, 0xFF0000FF, tmp);
}
return 1;
}
stock IsPlayerInArea(playerid, Float:MinX, Float:MinY, Float:MaxX, Float:MaxY)
{
new Float:pX, Float:pY, Float:pZ;
GetPlayerPos(playerid, pX, pY, pZ);
if(pX >= MinX && pX <= MaxX && pY >= MinY && pY <= MaxY)
return true;
else
return false;
}