Zone name
#1

Is there any way I can get an area's name using X,Y,Z coordiantes instead of playerid?

Ex

Код:
GetZoneName(Float:X,Float:Y,Float:Z,Dest[],sizeof(Dest[]));
Reply
#2

There is, you simply make the function that it needs to do that.
Reply
#3

Does that function already exists or do I need to modify: GetPlayer3DZone(playerid, szZone, sizeof(szZone));

I modified it to this:

Код:
stock GetZoneName(Float:x,Float:y,Float:z,zone[],len)
{

	for(new i = 0; i != sizeof(gSAZones); i++ )
 	{
		if(x >= gSAZones[i][SAZONE_AREA][0] && x <= gSAZones[i][SAZONE_AREA][3] && y >= gSAZones[i][SAZONE_AREA][1] && y <= gSAZones[i][SAZONE_AREA][4] && z >= gSAZones[i][SAZONE_AREA][2] && z <= gSAZones[i][SAZONE_AREA][5])
		{
		    return format(zone, len, gSAZones[i][SAZONE_NAME], 0);
		}
	}
	return 0;

}
Reply
#4

You should make another function to add to it. Then other code that uses the playerid based one will also work out.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)