17.06.2015, 13:58
Give this a shot:
I doubt it was an issue with your IsPlayerInArea, but here's my version if you want to try it:
pawn Код:
else if(!strcmp(Option, "Capture", true))
{
if(pInfo[playerid][Clan] == -1) return SendClientMessage(playerid, 0x989898FF, "[ERROR]: !аъд ма бчмап");
if(pInfo[playerid][ClanLevel] < 4) return SendClientMessage(playerid, 0x989898FF, "[ERROR]: шч сврй мйгш еотмд оешщйн мбцт фчегд жаъ");
if(!ServerData[CaptureAreas]) return SendClientMessage(playerid, 0x989898FF, "[ERROR]: айрк роца бажеш бц'чфейри щм лбйщд");
new bool:found = false;
for(new i = 0; i < ServerData[CaptureAreas]; i++)
{
if(IsPlayerInDynamicCP(playerid, CaptureData[i][CheckPoint]))
{
found = true;
if(CaptureData[i][ClanCapturing] > -1) return SendClientMessage(playerid, 0x989898FF, "[ERROR]: ажеш лбйщд жд лбш орсйн млбещ");
new CCount;
for(new j = 0, g = GetPlayerPoolSize(); j <= g; j++)
{
if(!IsPlayerConnected(j) || !pInfo[j][IsLogged]) continue;
if(pInfo[j][Clan] != pInfo[playerid][Clan]) continue;
if(IsPlayerInArea(j, CaptureData[i][GZMinX], CaptureData[i][GZMinY], CaptureData[i][GZMaxX], CaptureData[i][GZMaxY])) CCount++;
}
if(CCount < 3) return SendClientMessage(playerid, 0x989898FF, "[ERROR]: айп осфйч щзчрйн одчмап тм оръ млбещ, мфзеъ 3");
new Text[144];
CaptureData[i][ClanCapturing] = pInfo[playerid][Clan];
GangZoneFlashForAll(CaptureData[i][GangZone], pInfo[UserData[playerid][Clan]][CColor]);
CaptureAreaCountDown(pInfo[playerid][Clan], i, 180);
format(Text, sizeof(Text), "•> {D9DAF2}дзм дщъмиеъ тм ажеш длбйщд: {B03060}%s {%06x}%s {D9DAF2}дчмап", CaptureData[i][AreaName], ClanData[pInfo[playerid][Clan]][CColor] >>> 8, ClanData[UserDpInfota[playerid][Clan]][ClanName]);
SendClientMessageToAll(0xB03060FF, Text);
}
}
if(!found) return SendClientMessage(playerid, 0x989898FF, "[ERROR]: айрк роца бажеш бц'чфейри щм лбйщд");
}
pawn Код:
// At the top of your script
bool:IsPlayerInArea(playerid, Float:minx, Float:miny, Float:maxx, Float:maxy)
{
if(!IsPlayerConnected(playerid)) return false;
new Float:var, Float:playerposx, Float:playerposy;
if(minx > maxx)
{
var = minx;
minx = maxx;
maxx = var;
}
if(miny > maxy)
{
var = miny;
miny = maxy;
maxy = var;
}
GetPlayerPos(playerid, playerposx, playerposy, var);
if(minx <= playerposx <= maxx && miny <= playerposy <= maxy) return true;
return false;
}