if(!IsPlayerInRangeOfPoint( playerid, 7.0, -1955.7682, 306.0241, 41.0471 ) && !IsPlayerInRangeOfPoint( playerid, 7.0, -2051.8413, 86.1440, 28.3977 ) && !IsPlayerInRangeOfPoint( playerid, 7.0, -2141.5591, -256.7738, 40.7195 )&& !IsPlayerInRangeOfPoint( playerid, 7.0, 379.6270,-8.7878,1001.8516 ) && !IsPlayerInRangeOfPoint( playerid, 7.0, 216.6623,-100.1878,1005.2578 ) && !IsPlayerInRangeOfPoint( playerid, 7.0, 379.7124,-59.6829,1001.5078 ) ))
if(!IsPlayerInRangeOfPoint( playerid, 7.0, -2031.0654,-117.4350,1035.1719 && !IsPlayerInRangeOfPoint( playerid, 7.0, 365.1240,-6.7055,1001.8516 ) && !IsPlayerInRangeOfPoint( playerid, 7.0, -201.7283,-7.8537,1002.2734 ) && !IsPlayerInRangeOfPoint( playerid, 7.0, 296.7915,-35.3443,1001.5156 )))
if(!IsPlayerInRangeOfPoint( playerid, 7.0, -1955.7682, 306.0241, 41.0471 ) && !IsPlayerInRangeOfPoint( playerid, 7.0, -2051.8413, 86.1440, 28.3977 ) && !IsPlayerInRangeOfPoint( playerid, 7.0, -2141.5591, -256.7738, 40.7195 )&& !IsPlayerInRangeOfPoint( playerid, 7.0, 379.6270,-8.7878,1001.8516 ) && !IsPlayerInRangeOfPoint( playerid, 7.0, 216.6623,-100.1878,1005.2578 ) && !IsPlayerInRangeOfPoint( playerid, 7.0, 379.7124,-59.6829,1001.5078 ) )
if(!IsPlayerInRangeOfPoint( playerid, 7.0, -2031.0654,-117.4350,1035.1719 && !IsPlayerInRangeOfPoint( playerid, 7.0, 365.1240,-6.7055,1001.8516 ) && !IsPlayerInRangeOfPoint( playerid, 7.0, -201.7283,-7.8537,1002.2734 ) && !IsPlayerInRangeOfPoint( playerid, 7.0, 296.7915,-35.3443,1001.5156 )))
if(!IsPlayerInRangeOfPoint( playerid, 7.0, -2031.0654,-117.4350,1035.1719 && !IsPlayerInRangeOfPoint( playerid, 7.0, 365.1240,-6.7055,1001.8516 ) && !IsPlayerInRangeOfPoint( playerid, 7.0, -201.7283,-7.8537,1002.2734 ) && !IsPlayerInRangeOfPoint( playerid, 7.0, 296.7915,-35.3443,1001.5156 )))return SendClientMessage( playerid, red, "You are not at a robbery location." );
if(!IsPlayerInRangeOfPoint( playerid, 7.0, -2031.0654,-117.4350,1035.1719) && (!IsPlayerInRangeOfPoint( playerid, 7.0, 365.1240,-6.7055,1001.8516 ) && (!IsPlayerInRangeOfPoint( playerid, 7.0, -201.7283,-7.8537,1002.2734 ) && (!IsPlayerInRangeOfPoint( playerid, 7.0, 296.7915,-35.3443,1001.5156 ))))return SendClientMessage( playerid, red, "You are not at a robbery location." );
if(!IsPlayerInRangeOfPoint( playerid, 7.0, -2031.0654,-117.4350,1035.1719) && !IsPlayerInRangeOfPoint( playerid, 7.0, 365.1240,-6.7055,1001.8516 ) && !IsPlayerInRangeOfPoint( playerid, 7.0, -201.7283,-7.8537,1002.2734 ) && !IsPlayerInRangeOfPoint( playerid, 7.0, 296.7915,-35.3443,1001.5156 ))return SendClientMessage( playerid, red, "You are not at a robbery location." );
Consider using a constant array and a loop. Will be much easier to maintain.
|
new const stock Float:robberyPlaces[][3] = {
{-2031.0654, -117.4350, 1035.1719},
{365.1240, -6.7055, 1001.8516},
// you get the point
{-201.7283,-7.8537,1002.2734} // < no comma on the last one
};
for(new i; i < sizeof(robberyPlaces); i++)
{
if(IsPlayerInRangeOfPoint(playerid, 7.0, robberyPlaces[i][0], robberyPlaces[i][1], robberyPlaces[i][2])
{
// Do whatever you need to do
break; // exit the loop and continue with code outside of loop
// or you can put return instead if you want to end the function
}
}