tag mismatch
#1

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?
Reply
#2

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

it won't work :/
Reply
#4

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

thank you Misiur
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)