GetPlayer2DZone - Get3DZone
#1

Hi.. 2 questions:
1. what the differences between GetPlayer2DZone GetPlayer3DZone? (what makes it difference 2D 3D)
2. I made a command for GPS, there is a function called GetPlayer2DZone and its for playerid, i need function for house coordinates X Y Z and to say its street name but unfortunately it returns Blueberry acres...
If i set X Y Z HouseInfo[houseid][hExteriorX], HouseInfo[houseid][hExteriorY], HouseInfo[houseid][hExteriorZ]
then i get tag mismatch warning.
Sorry for my bad english

Here my cmd:

Код:
CMD:setgps(playerid, params[])
{
	new string[128], houseid;
	new zone[MAX_ZONE_NAME];
	if(PlayerInfo[playerid][pGPS] > 0)
	{
		if(sscanf(params, "d", houseid)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /setgps [houseid]");
		{
			SetPlayerCheckpoint(playerid, HouseInfo[houseid][hExteriorX], HouseInfo[houseid][hExteriorY], HouseInfo[houseid][hExteriorZ], 3);
			GetPlayer2DZone(HouseInfo[houseid][hExteriorX], HouseInfo[houseid][hExteriorY], HouseInfo[houseid][hExteriorZ], zone, MAX_ZONE_NAME);
			format(string, sizeof(string), "You have set your GPS to St. %s %d.", zone, houseid);
			SendClientMessageEx(playerid, COLOR_WHITE, string);
			}
		}
		else
		{
			SendClientMessageEx(playerid, COLOR_GRAD1, "You don't have a GPS.");
//		}
	}
	return 1;
}
Reply
#2

It's explained in its thread:

Quote:
Originally Posted by Cueball
Посмотреть сообщение
GetPlayer2DZone:
[i]@Info: Used to retrieve the players zone/area name. DOES NOT COMPARE HEIGHTS!

GetPlayer3DZone:
[i]@Info: Used to retrieve the players zone/area name and comparing with heights.
Modify GetPlayer2DZone to GetHouse2DZone and replace player's coordinates with those you input as arguments.
Reply
#3

Zones are 2D rectangles, so you don't need to pass Z-coordinate. You only need to use hExteriorX and hExteriorY.
Reply
#4

2D-Two-dimensional space
3D-Three dimensional Space
Please, read it because it is important to understand 3D and 2D Dimensions in scripting also it can be useful everywhere.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)