GangZoneCreate(128.1725,1274.4392,-365.3042,944.3629);
fiz isso no onplayerupdate
if(IsPlayerInArea(playerid,128.1725,1274.4392,-365.3042,944.3629) && arena == 3) {
return 1;
} else {
SendClientMessage(playerid, COLOR_RED, "volta pra arena ou vc vai ser morto!");
return 0;
}
e peguei essa stock no forum
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;
}
stock IsPlayerInPlace(playerid,Float:XMin,Float:YMin,Float:XMax,Float:YMax ) { new RetValue = 0; new Float:X,Float:Y,Float:Z; GetPlayerPos(playerid,X,Y,Z ); if( X >= XMin && Y >= YMin && X < XMax && Y < YMax ) { RetValue = 1; } return RetValue; }
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;
}
funciou editpawn porem quando to na gangzone fala que nao to
|
if(!IsPlayerInArea(playerid, 128.1725, 1274.4392, -365.3042, 944.3629))
if(IsPlayerInArea(playerid, 128.1725, 1274.4392, -365.3042, 944.3629))
forward VerificarArea();
public VerificarArea() {
static cont[MAX_PLAYERS];
if(arena == 3) {
for(new i; i != MAX_PLAYERS; i++) {
if(!IsPlayerConnected(i)) continue;
if(IsPlayerInArea(i, 128.1725, 1274.4392, -365.3042, 944.3629)) cont[i] = 0;
else
{
if(cont[i] == 3) {
cont[i] = 0;
SetPlayerHealth(i, 0.0);
SendClientMessage(i, COLOR_RED, "vocк foi morto!");
return 1;
}
SendClientMessage(i, COLOR_RED, "volta pra arena ou vc vai ser morto!");
cont[i]++;
}
}
SetTimer("VerificarArea", 1000, false);
}
return 1;
}