26.12.2015, 19:12
Tente dessa forma
PHP код:
CMD:iniciar(playerid)
{
arena = 3;
VerificarArea(playerid);
return 1;
}
forward VerificarArea(playerid); public VerificarArea(playerid) {
static cont;
if(arena == 3) {
if(!IsPlayerInArea(playerid, 128.1725, 1274.4392, -365.3042, 944.3629)) {
if(cont == 3) {
cont = 0;
SetPlayerHealth(playerid, 0.0);
SendClientMessage(playerid, COLOR_RED, "vocк foi morto!");
return 1;
}
SendClientMessage(playerid, COLOR_RED, "volta pra arena ou vc vai ser morto!");
cont++;
}
else cont = 0;
SetTimerEx("VerificarArea", 1000, false, "i", playerid);
}
return 1;
}
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;
}