08.07.2010, 22:13
Final GM:
Dai sу coloca em OnPlayerSpawn
Creio que funciona..
pawn Код:
stock PlayerInArea(playerid, Float:Xmin, Float:Ymin, Float:Xmax, Float:Ymax)
{
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
if(x <= Xmin && y <= Ymin && x >= Xmax && y >= Ymax) return 1;
return false;
}
forward IsPlayerInAreaAmmu(playerid);
public IsPlayerInAreaAmmu(playerid)
{
PlayerInArea(playerid,COORDENADAS_AREA_QUADRADA); /* COORDENADAS AQUI */
{
if(GetPlayerWantedLevel(playerid) >0)//Se Tiver Level de Policia
{
new name[MAX_PLAYER_NAME], string[44];
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "%s perto da area.",name);
SendClientMessageToAll(0xFFFF00AA, string);
SetTimer("IsPlayerInAreaAmmu",50000,false);//Tempo para dar para sair da area
}
}else{
IsPlayerInAreaAmmu(playerid);
}
return 1;
}
pawn Код:
IsPlayerInAreaAmmu(playerid);