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



tag mismatch - dominik523 - 21.07.2013

Hey! I don't know why do I get these warnings in my code. When VIP level 1 tries to buy a vehicle, it will lower a price for him for 15%. Here is the code:
Код:
switch(listitem)
	        {
	            case 0: {carid = 509; price = 1500;} // bike
	            case 1: {carid = 481; price = 2000;} // bmx
	            case 2: {carid = 581; price = 18000;} // bf-400
	            case 3: {carid = 521; price = 30000;} // FCR-900
	            case 4: {carid = 586; price = 15000;} // wayfarer
	            case 5: {carid = 468; price = 25000;} // sanchez
	        }
			if(PlayerInfo[playerid][pVIP] == 1) price = price-(price*0.15); // warning: tag mismatch
			else if(PlayerInfo[playerid][pVIP] == 2) price = price-(price*0.3); // warning: tag mismatch
			else if(PlayerInfo[playerid][pVIP] == 3) price = price-(price*0.45); // warning: tag mismatch
Does anyone know why do I get these warnings?


Re: tag mismatch - Rufio - 21.07.2013

pawn Код:
if(PlayerInfo[playerid][pVIP] == 1) { price = price-(price*0.15); }
try this if it doesnt I don't know any more solutions


Re: tag mismatch - dominik523 - 21.07.2013

it won't work :/


Re: tag mismatch - Misiur - 21.07.2013

pawn Код:
new Float:discount = 0.15 * PlayerInfo[playerid][pVIP];
price = floatround(price * (1 - discount), floatround_ceil);



Re: tag mismatch - dominik523 - 21.07.2013

thank you Misiur