24.11.2015, 14:09
PHP код:
stock IsPointInArea(Float:x,Float:y,Float:z,Float:minx,Float:miny,Float:minz,Float:maxx,Float:maxy,Float:maxz){
if((x >= minx && x <= maxx) && (y >= miny && y <= maxy) && (z >= minz && z <= maxz)) return true;
return false;
}
stock bool:IsMyLand(playerid){
new Float:Pos[3];
GetPlayerPos(playerid,Pos[0],Pos[1],Pos[2]);
for(new i; i < MAX_LANDS; i++){
if(IsPointInArea(Pos[0],Pos[1],0.0,LandInfo[i][landMinX],LandInfo[i][landMinY],-1.0,LandInfo[i][landMaxX],LandInfo[i][landMaxY],1.0)){
new pnick[MAX_PLAYER_NAME];
GetPlayerName(playerid,pnick,sizeof(pnick));
if(!strcmp(LandInfo[i][landOwner],pnick,true)) return true;
}
}
return false;
}