Intrested in why I am getting a tag mismath warning on my own function when called
#1

So, I have recently came back to SA:MP and have not messed around with PAWN for almost 2 years. Anyway, I just have been working on a gamemode for fun. Well I wanted to make a race script, so in my CreateRace function I have it as such
pawn Код:
stock CreateRace(racename[], Float:startPos[3], minimumRaces = 2, maxracelength = (1000 * 60 * 3), legalVehicles[10] = {0,0,0,0,0,0,0,0,0,0})
It returns the raceID for use with other functions.
But when I Call the function with something as such:
pawn Код:
new bump1 = CreateRace("Bump 1", {1747.3285,1452.9128,10.9435}, 1, (1000 * 60 * 3), {522, 0, 0, 0, 0, 0, 0, 0, 0, 0});
new bump2 = ...
...
I have the feeling it has to do with the "FloattartPos[3]", and "legalVehicles[10] = {0,....,0}". I went in-game to test to see if it is creating everything properly, and it is as well as getting the information where its need to go for use throughout the game mode. The only thing I can think of doing is having it go "Float, Float:y, Float:z", and "legalVehicles[]" and have legal vehicles as a string I split. But this seems wasteful on resources to split a string. I have tried to find a similar issue and explanation as to why, or how to do it while subsiding the warnings. I don't wan't to hide the warnings but rather fix, but I am not sure how. [+] rep to ever can explain how to do it properly, as well explain why the method above is creating the warnings. I am here to learn, not to be annoying.
Reply
#2

What are the errors? show us
Reply
#3

As explained its not a error, its a tag mismath.

The warnings is
Код:
custom.pwn(490) : warning 213: tag mismatch
and that line is
pawn Код:
new bump1 = CreateRace("Bump 1", {1747.3285,1452.9128,10.9435}, 1, (1000 * 60 * 3), {522, 0, 0, 0, 0, 0, 0, 0, 0, 0});
As I stated I am curious as to why I have a tag mismatch. The function physically works, and there are no issues with it when I tested it, but I would rather not have the warnings and know the proper way to resolved the issue. The function code it self is fine.
Reply
#4

Try creating an array and then passing it to the function, if it makes any difference?

pawn Код:
new Float: arr[ 3 ] = { 1747.3285, 1452.9128, 10.9435 } ;

new bump_1 = CreateRace( "Bump", arr ... );
I have no idea because I haven't seen the code, but anyways!
Reply
#5

Hah, irony.
I changed:
pawn Код:
new bump1 = CreateRace("Bump 1", {1747.3285,1452.9128,10.9435}, 1, (1000 * 60 * 3), {522, 0, 0, 0, 0, 0, 0, 0, 0, 0});
to
pawn Код:
new bump1 = CreateRace("Bump 1", Float:{1747.3285,1452.9128,10.9435}, 1, (1000 * 60 * 3), {522, 0, 0, 0, 0, 0, 0, 0, 0, 0});
and the issue is resolved. Did not occur to me at first that I still had to initialize the array as a Float:{posx, posy, posz}. [+] Rep to you Rajat for posting that though right before I tried adding Float: to it.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)