if(strcmp(cmdtext, "/enter", true, 10) == 0) { if(IsPlayerInRangeOfPoint(playerid, 3.0, 1975.9144,1612.8906,9.86875)) if(IsPlayerInRangeOfPoint(playerid, 3.0, 2017.9628,1103.1355,10.8203)) { SetPlayerPos(playerid, 268.36044311523, -48.938175201416, 375.28506469727); SetPlayerInterior(playerid, 0); SetPlayerPos(playerid, 290.85040283203, -73.214797973633, 1006.8); SetPlayerInterior(playerid, 1); } else { SendClientMessage(playerid, 0xFA0505FF, "You are not near the enterance."); } return 1; } if(strcmp(cmdtext, "/exit", true, 10) == 0) { if(IsPlayerInRangeOfPoint(playerid, 3.0, 265.4691,-49.8297,374.7559)) { SetPlayerPos(playerid, 1978.0145, 1616.1121, 10.0781); SetPlayerInterior(playerid, 0); } else { SendClientMessage(playerid, 0xFA0505FF, "You are not near the exit."); } return 1; } return SendClientMessage(playerid, 0xFFFFFFAA, "[ELITE GANGWARS]: This command wasn't found. Please use /ehelp"); }
if(IsPlayerInRangeOfPoint(playerid, 3.0, 2017.9628,1103.1355,10.8203))
{
SetPlayerPos(playerid, 268.36044311523, -48.938175201416, 375.28506469727);
SetPlayerInterior(playerid, 0);
}
else if(IsPlayerInRangeOfPoint(playerid, 3.0, second coords))
{
SetPlayerPos(playerid, 290.85040283203, -73.214797973633, 1006.8);
SetPlayerInterior(playerid, 1);
}
But, try making it dynamic by saving each and every house's entrance coordinates and just looping around them all checking if he's at one of them.
It would save you time and a whole lot of lines. |