is there something wrong with my pawno?
#1

i did this as an example:
i went ingame, and 'angle' (see code below) was 60.0
pawno does:
Код:
format(text, sizeof text, "angle = %f", angle);
and says: angle = 60
ok everything works

then i calculated (with my own calculator and not pawno) the Px2 where the player will be placed:

cos(60)*1 = 0.5 //(because distance was 1.0)
0.5+0.0 = 0.5 //(because "x" was 0.0)

so Px2 should be 0.5
if pawno calculates it, Px2 is -0.88 -_-

wtf
what's wrong with this?

this is the code:
Код:
	new text[64];
	format(text, sizeof text, "angle = %f", angle);
	SendClientMessage(playerid, 0xFF3399AA, text);

	new Float:Px2, Float:Py2;
	Px2 = floatmul(floatcos(angle), distance);
	Py2 = floatmul(floatsin(angle), distance);

	if (Px > x && Py > y) //1
	{
		Px2 = floatadd(x, Px2);
		Py2 = floatadd(y, Py2);
		SendClientMessage(playerid, 0xFF3399AA, "1");
	}
	else if (Px <= x && Py >= y) //2
	{
		Px2 = floatsub(x, Px2);
		Py2 = floatadd(y, Py2);
		SendClientMessage(playerid, 0xFF3399AA, "2");
	}
	else if (Px >= x && Py <= y) //3
	{
		Px2 = floatadd(x, Px2);
		Py2 = floatsub(y, Py2);
		SendClientMessage(playerid, 0xFF3399AA, "3");
	}
	else if (Px < x && Py < y) //4
	{
		Px2 = floatsub(x, Px2);
		Py2 = floatsub(y, Py2);
		SendClientMessage(playerid, 0xFF3399AA, "4");
	}

	format(text, sizeof text, "Px2 = %f | Py2 = %f", Px2, Py2);
	SendClientMessage(playerid, 0xFF3399AA, text);

	SetPlayerPos(playerid, Px2, Py2, Pz);
Reply
#2

-oups-
Reply
#3

Quote:
Originally Posted by 0rb
English please
huh?
Reply
#4

Quote:
Originally Posted by 0rb
English please
that is engish lol xD + i have no idea why
Reply
#5

Quote:
Originally Posted by 0rb
-oups-
it's ok

ps it's fixed -> i had to toggle to degrees instead of radians
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)