[Pawn] Many warnings related to types or...? - Printable Version + open.mp forum (https://forum.open.mp) -- Forum: SA-MP (https://forum.open.mp/forumdisplay.php?fid=3) --- Forum: Pawn Scripting (https://forum.open.mp/forumdisplay.php?fid=10) --- Thread: [Pawn] Many warnings related to types or...? (/showthread.php?tid=2538) |
Many warnings related to types or...? - SyNNzka - 2024-01-03 Hello and happy new year. I have issues with so many warning rises when compiling, and I wanna know the good way of fixing them and the exact reason (like is some types restrictions?) For example, I have this code: Code: PlayerTextDrawAlignment(playerid, RPMLine[17], 2); The warning disappear if I use TEXT_DRAW_ALIGN_CENTER instead of 2. Code: PlayerTextDrawAlignment(playerid, RPMLine[17], TEXT_DRAW_ALIGN_CENTER); It's really annoying that I need to replace this for every system that I have in my gamemode... And I don't understand why, because in the official wiki we can see that 1, 2 and 3 values (1-left, 2-centered, 3-right) are agreeaded, but still I got worning... Another more annoying example is: Code: new engine, lights, alarm, doors, bonnet, boot, objective; And I got this warnings... "warning 213: tag mismatch: expected tag "bool", but found none ("_")" like x6 times for GetVehicleParamsEx and x3 times for SetVehicleParamsEx. How should I define new variables to be type bool? I did not find any problem for this in the official wiki, as I see that the defined variables was made the same (https://www.open.mp/docs/scripting/functions/GetVehicleParamsEx) One more example.... Code: SetPlayerRaceCheckpoint(playerid, 1, randomPizza[r][0], randomPizza[r][1], randomPizza[r][2], 0.0, 0.0, 0.0, 2.5); And the warning I got is: "warning 213: tag mismatch: expected tag "t_CP_TYPE", but found none ("_")" as the first example issue. Is some problem related to my pawnc.dll & pawncc.exe versions? (I used the pawn version that comes with the server openmp) I really don't know what to do and I don't want to use #pragma... Appreciate your help, thanks! RE: Many warnings related to types or...? - Mido - 2024-01-06 That's just how things are now. About the player race checkpoint just add `CP_TYPE:` before the checkpoint type parameter. Code: SetPlayerRaceCheckpoint(playerid, CP_TYPE:1, ...); RE: Many warnings related to types or...? - Verc - 2024-01-06 Ignore 't_' and search for 'CP_TYPE' in open.mp's libraries and you will find it. Code: enum CP_TYPE:__CP_TYPE (2024-01-06, 12:32 AM)Mido Wrote: That's just how things are now. ??? just search for the right checkpoint type RE: Many warnings related to types or...? - Mido - 2024-01-06 You don't have to be doing all of that. But I appreciate you pointing that out. RE: Many warnings related to types or...? - SyNNzka - 2024-01-07 Thank you all for the answers. In the conclusion that's how variables definitions now works with open.mp library. Also, for the warning "warning 213: tag mismatch: expected tag "bool", but found none ("_")" in the above case: Code: new engine, lights, alarm, doors, bonnet, boot, objective; The solution is to define the type of the variables as bool like so: Code: new bool:engine, bool:lights, bool:alarm, bool:doors, bool:bonnet, bool:boot, bool:objective; Similar with the old "Float" declaration from the old a_samp library. Many thanks! |