SA-MP Forums Archive
why tag mismatch ? - 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: why tag mismatch ? (/showthread.php?tid=517000)



why tag mismatch ? - AnonScripter - 02.06.2014

what's wrong in here ?

pawn Код:
new NewMoney = HitMoney[targetid] * 0.75;



Re: why tag mismatch ? - kamiliuxliuxliux - 02.06.2014

Maybe *= instead of *




Re: why tag mismatch ? - Aerotactics - 02.06.2014

Quote:
Originally Posted by AnonScripter
Посмотреть сообщение
what's wrong in here ?
pawn Код:
new NewMoney= HitMoney[targetid] * 0.75;
Is NewMoney an array?


Re: why tag mismatch ? - AnonScripter - 02.06.2014

NewMoney is a under a command.
HitMoney is a variable on the top of the script.


Re: why tag mismatch ? - iZN - 02.06.2014

Money can't be a float! 0.75 is a float value. Just multiply it with some integer, not float.


Re: why tag mismatch ? - AnonScripter - 02.06.2014

Quote:
Originally Posted by iZN
Посмотреть сообщение
Money can't be a float! 0.75 is a float value. Just multiply it with some integer, not float.
i hope it will work if i do:
pawn Код:
new NewMoney= HitMoney[targetid] * (75/100);



Re: why tag mismatch ? - iZN - 02.06.2014

Quote:
Originally Posted by AnonScripter
Посмотреть сообщение
i hope it will work if i do:
pawn Код:
new NewMoney= HitMoney[targetid] * (75/100);
You're actually not getting my point. For example, if your hit money is $55, so 55*75/100 = 41.25 which is an INVALID value for money. If it's for different purpose other than money, than use Float: tag. "new Float:NewMoney = .."


Re: why tag mismatch ? - AnonScripter - 02.06.2014

Quote:
Originally Posted by iZN
Посмотреть сообщение
You're actually not getting my point. For example, if your hit money is $55, so 55*75/100 = 41.25 which is an INVALID value for money. If it's for different purpose other than money, than use Float: tag. "new Float:NewMoney = .."
if the hitmoney is $55, then the new money will be $41 instead of $41.25
Tested and worked