SA-MP Forums Archive
Zone name - 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: Zone name (/showthread.php?tid=611087)



Zone name - SystemX - 02.07.2016

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[]));



Re: Zone name - Sew_Sumi - 02.07.2016

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


Re: Zone name - SystemX - 02.07.2016

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;

}



Re: Zone name - Sew_Sumi - 02.07.2016

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