[Include] [Function]IsPlayerInRange
#1

Hello,

So this is nothing like IsPlayerInRangeOfPoint, well it is, but this function is looking X and Y Coordinates. There is nothing like Float:range. Here is the code.

pawn Код:
stock IsPlayerInRange(Float:Start_X, Float:Start_Y, Float:End_X, Float:End_Y, playerid){
    new Float:Current_X, Float:Current_Y, Float:Current_Z;
    GetPlayerPos(playerid, Current_X, Current_Y, Current_Z);
    if(Start_X >= Current_X && End_X <= Current_X && Start_Y <= Current_Y && End_Y >= Current_Y){
        return 1;
    }else{
        return 0;
    }
}

Start_X must always be higher value than End_X, and Start_Y smaller than End_Y...
Reply


Messages In This Thread
[Function]IsPlayerInRange - by CoaPsyFactor - 08.06.2011, 19:40
Re: [Function]IsPlayerInRange - by MicroD - 08.06.2011, 19:41
Re: [Function]IsPlayerInRange - by Gamer_Z - 08.06.2011, 21:16
Re: [Function]IsPlayerInRange - by CoaPsyFactor - 08.06.2011, 21:18
Re: [Function]IsPlayerInRange - by Gamer_Z - 08.06.2011, 21:20
Re: [Function]IsPlayerInRange - by CoaPsyFactor - 08.06.2011, 21:21
Re: [Function]IsPlayerInRange - by CoaPsyFactor - 08.06.2011, 21:40
Re: [Function]IsPlayerInRange - by Mike Garber - 08.06.2011, 22:24
Re: [Function]IsPlayerInRange - by CoaPsyFactor - 09.06.2011, 11:45

Forum Jump:


Users browsing this thread: 1 Guest(s)