GetPlayer2DZone - Get3DZone - 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: GetPlayer2DZone - Get3DZone (
/showthread.php?tid=492795)
GetPlayer2DZone - Get3DZone -
Lidor124 - 05.02.2014
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;
}
Re: GetPlayer2DZone - Get3DZone -
Konstantinos - 05.02.2014
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.
Re: GetPlayer2DZone - Get3DZone -
Borg - 05.02.2014
Zones are 2D rectangles, so you don't need to pass Z-coordinate. You only need to use hExteriorX and hExteriorY.
Re: GetPlayer2DZone - Get3DZone -
[EnErGyS]KING - 05.02.2014
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.