Problema con IsPlayerInRangeOfPoint
#1

Buenas noches.

Acudo acб por un problema que tengo con un comando, estoy tratando de restringir un comando a cierta posiciуn pero siempre me conduce al else, no se que estoy haciendo mal.

COMANDO
Код:
COMMAND:fastfood(playerid, params[])
{
	for(new i=0;i<sizeof(FastFood);i++)
	{
		if(IsPlayerInRangeOfPoint(playerid, 2, FastFood[i][FastPos][0], FastFood[i][FastPos][1], FastFood[i][FastPos][2]))
		{
			if(TieneHotDog[playerid] == 3)
			{
				SendClientMessage(playerid, COLOR_BLANCO, "{FFFFFF}Solo puedes comprar{FF0000}3 {FFFFFF}HotDogs.");
				return 1;
			}
			if(GetPlayerMoney(playerid) < 50)
			{
				SendClientMessage(playerid, COLOR_BLANCO, "{FFFFFF}No tienes dinero suficiente. Necesitas{FF0000}$50 {FFFFFF}para comprar un Hotdog");
				return 1;
			}
			TieneHotDog[playerid] += 1;
			new string[256];
			format(string, COLOR_BLANCO, "{FFFFFF}Has comprado un HotDog por {FF0000}$50{FFFFFF}, Tu ahora tienes {FF0000}%d {FFFFFF}HotDog(s)", TieneHotDog);
			SendClientMessage(playerid, COLOR_BLANCO, string);
			GivePlayerMoney(playerid, -50);
		}
		else
		{
			SendClientMessage(playerid, COLOR_BLANCO, "No estбs cerca de un puesto de hotdogs");
			return 1;
		}
	}
	return 1;
}
POSICIONES:
Код:
new TieneHotDog[MAX_PLAYERS];
enum _@fast@food
{
	FastObjeto,
	Float:FastPos[3],
	Float:FastRot[3],
};
new FastFood[][_@fast@food] =
{
	//ID del objeto - Posciones - Rotaciones
        {1340, {1212.1949, -1376.4700, 13.5225}, {0.0000, 0.0000, 179.8999}},
        {1340, {1363.9271, -1299.6983, 13.7025}, {0.0000, 0.0000, -179.4999}},
	{1340, {805.0296, -1387.6784, 13.5734}, {0.5000, 0.0000, -142.8000}},
	{1340, {566.2661, -1246.8785, 17.3403}, {-1.0000, -1.2999, 114.9999}},
	{1340, {1032.2615, -948.2105, 42.6680}, {2.0999, 1.3999, -82.4000}},
	{1340, {1522.1754, -1724.9471, 13.6701}, {0.0000, 0.0000, -50.1999}},
	{1340, {1436.9066, -1599.1942, 13.6419}, {0.0000, 0.0000, 130.8000}},
	{1340, {1370.3024, -1738.3558, 13.6413}, {0.0000, 0.0000, 90.8000}},
	{1340, {1597.8076, -1326.3916, 17.5089}, {0.0000, 0.0000, 0.0000}},
	{1340, {1964.2001, -1454.7465, 13.5899}, {0.0000, 0.0000, -89.9000}},
	{1340, {2262.2397, -1665.1345, 15.4870}, {0.0000, 0.0000, 89.8000}},
	{1340, {1687.1517, -1864.3568, 13.5824}, {0.0000, 0.0000, 146.6999}},
	{1340, {375.2545, -1998.6033, 7.8528}, {0.0000, 0.0000, -179.1999}},
	{1340, {429.8251, -1778.2717, 5.6128}, {0.0000, 0.0000, 90.0999}}
};
Reply
#2

Solucionado.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)