SA-MP Forums Archive
tag mismatch with the usage of acos and asin - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: tag mismatch with the usage of acos and asin (/showthread.php?tid=253251)



tag mismatch with the usage of acos and asin - nuriel8833 - 05.05.2011

Hello
I was using the functions acos and asin in something:
pawn Код:
GivePlayerMoney(playerid,X(acos(X)-asin(X)-X)-2);
GivePlayerMoney(playerid,X(acos(X)-asin(X)-X)-2);
But I get those warnings while compiling:
pawn Код:
warning 213: tag mismatch
warning 213: tag mismatch
Can someone help me?


Re: tag mismatch with the usage of acos and asin - Zh3r0 - 05.05.2011

How's X defined? What tag you assigned to it?


Re: tag mismatch with the usage of acos and asin - nuriel8833 - 05.05.2011

Quote:
Originally Posted by Zh3r0
Посмотреть сообщение
How's X defined? What tag you assigned to it?
pawn Код:
new X =random(GetPlayerMoney(ID));



Re: tag mismatch with the usage of acos and asin - Zh3r0 - 05.05.2011

acos and asin need the Float: tag.

Also, GivePlayerMoney doesn't support float numbers.


Re: tag mismatch with the usage of acos and asin - Joe Staff - 05.05.2011

I was messing with your formula a little bit, and asin and acos, no matter how they're used within the formula, will cause everything to return 0.....

example:
pawn Код:
printf("%f",asin(500));
returns 0;
pawn Код:
printf("%f",asin(500)+500);
returns 0;
pawn Код:
printf("%f",500);
returns 500;

EDIT: Just realized that acos/asin can only have a number between -1 and 1, lol


Re: tag mismatch with the usage of acos and asin - Zh3r0 - 05.05.2011

Quote:
Originally Posted by SilentHuntR
Посмотреть сообщение
I was messing with your formula a little bit, and asin and acos, no matter how they're used within the formula, will cause everything to return 0.....

example:
pawn Код:
printf("%f",asin(500));
returns 0;
pawn Код:
printf("%f",asin(500)+500);
returns 0;
pawn Код:
printf("%f",500);
returns 500;

EDIT: Just realized that acos/asin can only have a number between -1 and 1, lol
False!

Код:
printf("asin: %d acos: %d",asin(Float:46), acos(Float:46));
printf("asin: %f acos: %f",asin(Float:46), acos(Float:46));
result

Код:
asin: 2636 acos: 1119092735
asin: 0.000000 acos: 89.999992
Never been into these acos asin stuff, i hate mathematics!


Re: tag mismatch with the usage of acos and asin - nuriel8833 - 05.05.2011

Quote:
Originally Posted by Zh3r0
Посмотреть сообщение
acos and asin need the Float: tag.

Also, GivePlayerMoney doesn't support float numbers.
So how can I make it support floats?

Quote:
Originally Posted by SilentHuntR
Посмотреть сообщение
I was messing with your formula a little bit, and asin and acos, no matter how they're used within the formula, will cause everything to return 0.....

example:
pawn Код:
printf("%f",asin(500));
returns 0;
pawn Код:
printf("%f",asin(500)+500);
returns 0;
pawn Код:
printf("%f",500);
returns 500;

EDIT: Just realized that acos/asin can only have a number between -1 and 1, lol
Where are you getting to?


Re: tag mismatch with the usage of acos and asin - Zh3r0 - 05.05.2011

You can't, maybe there is a way around this of what you try to do ?


Re: tag mismatch with the usage of acos and asin - Joe Staff - 05.05.2011

Quote:
Originally Posted by Zh3r0
Посмотреть сообщение
False!

Код:
printf("asin: %d acos: %d",asin(Float:46), acos(Float:46));
printf("asin: %f acos: %f",asin(Float:46), acos(Float:46));
result

Код:
asin: 2636 acos: 1119092735
asin: 0.000000 acos: 89.999992
Never been into these acos asin stuff, i hate mathematics!
Try changing your acos number to anything above 1, it comes out with the same result everytime...


Re: tag mismatch with the usage of acos and asin - nuriel8833 - 05.05.2011

Quote:
Originally Posted by Zh3r0
Посмотреть сообщение
You can't, maybe there is a way around this of what you try to do ?
I've tried doing stocks and another arguments,but it only gives me more errors