Tag mismatch -
Dziugsas - 23.04.2014
Hello guys!
I ran into a trouble , i'm trying to make tires health system and i can't sendclientmessage about the tires health i get 4 warnings:
pawn Код:
warning 213: tag mismatch
pawn Код:
new string0[100],string1[100],string2[100],string3[100];
new rand = random(1500);
////////////////////////////////////////////////
TireInfo[vehicleid][Front_Left_Tire] -= GetPlayerSpeed(i)/rand;
TireInfo[vehicleid][Front_Right_Tire] -= GetPlayerSpeed(i)/rand;
TireInfo[vehicleid][Rear_Left_Tire] -= GetPlayerSpeed(i)/rand;
TireInfo[vehicleid][Rear_Right_Tire] -= GetPlayerSpeed(i)/rand;
format(string0 , sizeof(string0) , "%d priekine kaire padanga.",Front_Left_Tire); ///ERORR
SendClientMessage(i,COLOR_RED,string0);
format(string1 , sizeof(string1) , "%d priekine desine padanga.",Front_Right_Tire); ///ERORR
SendClientMessage(i,COLOR_RED,string1);
format(string2 , sizeof(string2) , "%d galine kaire padanga.",Rear_Left_Tire); ///ERORR
SendClientMessage(i,COLOR_RED,string3);
format(string3 , sizeof(string1) , "%d galine desine padanga.",Rear_Right_Tire); ///ERORR
SendClientMessage(i,COLOR_RED,string3);
What is the problem?
Re: Tag mismatch -
Bingo - 23.04.2014
pawn Код:
SendClientMessage(i,COLOR_RED,string1);
Change
i to
playerid? Try if that works if not then make sure you defined
i.
Re: Tag mismatch -
Konstantinos - 23.04.2014
Front_Left_Tire,
Front_Right_Tire,
Rear_Left_Tire and
Rear_Right_Tire are indexes of the enum and that's why you get the warning. You should use the TireInfo array.
pawn Код:
new string0[50];
...
format(string0, sizeof(string0), "%d priekine kaire padanga.", TireInfo[vehicleid][Front_Left_Tire]);
SendClientMessage(i,COLOR_RED,string0);
format(string0, sizeof(string0), "%d priekine desine padanga.", TireInfo[vehicleid][Front_Right_Tire]);
SendClientMessage(i,COLOR_RED,string0);
format(string0, sizeof(string0), "%d galine kaire padanga.", TireInfo[vehicleid][Rear_Left_Tire]);
SendClientMessage(i,COLOR_RED,string0);
format(string0, sizeof(string0), "%d galine desine padanga.", TireInfo[vehicleid][Rear_Right_Tire]);
SendClientMessage(i,COLOR_RED,string0);
Actually, you don't need all those arrays. 1 is just fine.
Re: Tag mismatch -
Riddick94 - 23.04.2014
Could you please provide your 'i' variable? I don't really think that is a whole code. By the way, tag mismatch is probably missing TAG somewhere before you've defined your variable/array.
What tag has your Front_Left_Tire array and the rest of them?
edit:\\
or as Konstantinos said.
Re: Tag mismatch -
Bingo - 23.04.2014
Also just now i noticed he did mistake here too,
pawn Код:
format(string2 , sizeof(string2) , "%d galine kaire padanga.",Rear_Left_Tire); ///ERORR
SendClientMessage(i,COLOR_RED,string3);//string 3
format(string3 , sizeof(string1) , "%d galine desine padanga.",Rear_Right_Tire); ///ERORR
SendClientMessage(i,COLOR_RED,string3);//string 3 same
Correctly:-
pawn Код:
format(string2 , sizeof(string2) , "%d galine kaire padanga.",Rear_Left_Tire); ///ERORR
SendClientMessage(i,COLOR_RED,string2);
format(string3 , sizeof(string1) , "%d galine desine padanga.",Rear_Right_Tire); ///ERORR
SendClientMessage(i,COLOR_RED,string3);
Re: Tag mismatch -
Dziugsas - 23.04.2014
Thank you Konstantinos.Worked!