SA-MP Forums Archive
Disable command in zone! - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Disable command in zone! (/showthread.php?tid=248804)



Disable command in zone! - Admigo - 15.04.2011

heey guys

I want to disable a command in a zone! Because i make a DeathMatch zone but there are no vehicles alowed and i made a carmenu for the server.

Thanks Admigo


Re: Disable command in zone! - Kayaque - 15.04.2011

pawn Код:
if(IsPlayerInRangeOfPoint(playerid, size of zone, middle_of_zone_X,  middle_of_zone_Z, middle_of_zone_Y))
{
SendClientMessage(playerid, COLOR, "You can't use this command within this zone!");
}
else
{
Let the command work
}
return 1;
}



Re: Disable command in zone! - Steven82 - 15.04.2011

That ^ is not a zone, thats an area. A zone would be an area of something example. a 4x4 piece of graph paper is a zone, but that is just cords and won't work the same


Re: Disable command in zone! - admantis - 15.04.2011

He probably wants to use this script I just made
pawn Код:
stock IsPlayerIn2DArea(playerid, Float:fMin_Y, Float:fMax_Y, Float:fMin_Y, Float:fMax_Y) // Written by Admantis
{
    new Float:fX, Float:fY;
    if (fX > fMin_X && fX < fMax_X && fY > fMin_Y && fY < fMax_Y)
        return true;
    return false;
}