SA-MP Forums Archive
Fast Please [rep++] - 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)
+--- Thread: Fast Please [rep++] (/showthread.php?tid=558896)



Fast Please [rep++] - nezo2001 - 19.01.2015

I want to make IsPlayerInRangOfPoint but for a base
so the base cor. like that "minx, miny, maxx, maxy"
And IsPlayerInRangrOfPoint is like this "radius, x, y, z"
So how to make it ??
Please Fast Help Rep


Re: Fast Please [rep++] - Ironboy - 19.01.2015

Use this http://forum.sa-mp.com/showthread.ph...terDynamicArea


Re: Fast Please [rep++] - Kaperstone - 19.01.2015

2d
pawn Код:
new Float:x,Float:y,Float:z;
GetPlayerPos(playerid, x, y, z);
if(x<=minx && x>=maxx && y<=miny && y>=maxy) {
// He is in that area
}
3d
pawn Код:
new Float:x,Float:y,Float:z;
GetPlayerPos(playerid, x, y, z);
if(x<=minx && x>=maxx && y<=miny && y>=maxy && z<=minz && z>=maxy) {
// He is in that area
}



Re: Fast Please [rep++] - RayC - 19.01.2015

Try this, if you have your bases defined, then just add
Код:
Float:fBaseX,
	Float:fBaseY,
	Float:fBaseZ,
into the enum like:

Код:
#define MAX_BASE 5
enum base
{
	Float:fBaseX,
	Float:fBaseY,
	Float:fBaseZ
};
new BaseInfo[MAX_BASE][Base];
then you can just use:

Код:
for(new x; x < MAX_BASE; x++)
	{
	    if(IsPlayerInRangeOfPoint(playerid, 3.0, BaseInfo[x][fBaseX], BaseInfo[x][fBaseY], BaseInfo[x][fBaseZ]))



Re: Fast Please [rep++] - nezo2001 - 19.01.2015

Thank all and thanks for kaperstone amazing idea rep
But i think streamer is better can anyone help me in
IsPlayerInDynamicArea with its params plz help thank you and repped IronBoy


Re: Fast Please [rep++] - Schneider - 19.01.2015

Quote:
Originally Posted by Kaperstone
Посмотреть сообщение
2d
pawn Код:
new Float:x,Float:y,Float:z;
GetPlayerPos(playerid, x, y, z);
if(x<=minx && x>=maxx && y<=miny && y>=maxy) {
// He is in that area
}
@Kaperstone: You got the operators flipped: > means larger, < means smaller.

pawn Код:
new Float:x,Float:y,Float:z;
GetPlayerPos(playerid, x, y, z);
if(x>=minx && x<=maxx && y>=miny && y<=maxy) {
// He is in that area
}



Re: Fast Please [rep++] - nezo2001 - 19.01.2015

IsPlayerInDynamicAreaaaaaa please another rep


Re: Fast Please [rep++] - CalvinC - 19.01.2015

Quote:
Originally Posted by CalvinC
Посмотреть сообщение
Haven't used it before, for the params just check the topic.
pawn Код:
IsPlayerInDynamicArea(playerid, areaid, recheck = 0);
It might work like this, not sure though.
https://sampwiki.blast.hk/wiki/Areacheck
As i said on your new topic.


Re: Fast Please [rep++] - nezo2001 - 19.01.2015

Check my replay in my new topic


Re: Fast Please [rep++] - Kaperstone - 20.01.2015

Quote:
Originally Posted by Schneider
Посмотреть сообщение
@Kaperstone: You got the operators flipped: > means larger, < means smaller.

pawn Код:
new Float:x,Float:y,Float:z;
GetPlayerPos(playerid, x, y, z);
if(x>=minx && x<=maxx && y>=miny && y<=maxy) {
// He is in that area
}
oh lol, didn't notice.
thanks for pointing out.