Problem with multiplication
#1

What could be the problem?

Код:
warning 213: tag mismatch
pawn Код:
GivePlayerMoney( playerid, SERVERIO_NAMAI[ ID ][ Namo_Kaina ] * 0.08);
Thanks : )
Reply
#2

GivePlayerMoney() uses an interger. due to the multiplication by 0.08, it becomes a float. simple solution:
Код:
GivePlayerMoney( playerid, floatround( SERVERIO_NAMAI[ ID ][ Namo_Kaina ] * 0.08),floatround_floor);
Reply
#3

Is: "SERVERIO_NAMAI[ ID ][ Namo_Kaina ]" a float?
GivePlayerMoney(..) can only use Integers, as SA does not support decimalised currency.
And, what is "ID"?

Edit: I posted at the same time as Babul (a)
Reply
#4

Thanks, but now: data/GUI.pwn(1690) : warning 202: number of arguments does not match definition
Reply
#5

pawn Код:
GivePlayerMoney( playerid, ( floatround ( SERVERIO_NAMAI[ ID ][ Namo_Kaina ] * 0.08 ), floatround_floor ) );
Reply
#6

funky: it's house id from cycle for

pawn Код:
for( new ID; ID < MAX_HOUSES; ID++ )
Reply
#7

Quote:
Originally Posted by RenisiL
Посмотреть сообщение
funky: it's house id from cycle for

pawn Код:
for( new ID; ID < MAX_HOUSES; ID++ )
Ah

Use floatround(..) as Babul suggested, or don't multiply it by 0.08. Why are you multiplying it by that anyway, what's it for?
Reply
#8

Thanks all, problem solved : )
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)