Is player in range of an object
#5

pawn Код:
new atm[50];

atm[0] = CreateObject(...)
atm[1] = CreateObject(...)
atm[2] = CreateObject(...)
atm[49] = CreateObject(...)

// command
new x = 0;
for(new i = 0; i < sizeof(atm); i++)
{
    new Float:Pos[3];
    GetObjectPos(atm[i], Pos[0], Pos[1], Pos[2]);
    if(IsPlayerInRangeOfPoint(playerid, 3.0, Pos[0], Pos[1], Pos[2])) x++;
}
if(x == 0) return SendClientMessage(playerid, 0xFF0000FF, "You are not near the ATM machine!");
// rest of code (if is near the atm machine)
Reply


Messages In This Thread
Is player in range of an object - by The Woody - 11.04.2011, 21:51
Re: Is player in range of an object - by Voldemort - 11.04.2011, 22:08
Re: Is player in range of an object - by The Woody - 11.04.2011, 22:10
Re: Is player in range of an object - by Joe Staff - 11.04.2011, 22:19
Re: Is player in range of an object - by Pooh7 - 11.04.2011, 22:22
Re: Is player in range of an object - by The Woody - 11.04.2011, 22:26
Re: Is player in range of an object - by Joe Staff - 11.04.2011, 22:33
Re: Is player in range of an object - by The Woody - 12.04.2011, 11:21
Re: Is player in range of an object - by CyNiC - 12.04.2011, 12:59
Re: Is player in range of an object - by The Woody - 12.04.2011, 17:18

Forum Jump:


Users browsing this thread: 1 Guest(s)