Tag mismatch
#1

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

pawn Код:
SendClientMessage(i,COLOR_RED,string1);
Change i to playerid? Try if that works if not then make sure you defined i.
Reply
#3

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.
Reply
#4

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.
Reply
#5

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);
Reply
#6

Thank you Konstantinos.Worked!
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)