• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Pawn] Many warnings related to types or...?
#1
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;
        GetVehicleParamsEx(vehID, engine, lights, alarm, doors, bonnet, boot, objective);
        SetVehicleParamsEx(vehID, VEHICLE_PARAMS_OFF, VEHICLE_PARAMS_OFF, alarm, doors, VEHICLE_PARAMS_OFF, VEHICLE_PARAMS_OFF, 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/funct...leParamsEx)



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!
  Reply
#2
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, ...);
  Reply
#3
Ignore 't_' and search for 'CP_TYPE' in open.mp's libraries and you will find it.

Code:
enum CP_TYPE:__CP_TYPE
{
UNKNOWN_CP_TYPE                            = -1,
CP_TYPE_GROUND_NORMAL                      = 0,
CP_TYPE_GROUND_FINISH                      = 1,
CP_TYPE_GROUND_EMPTY                      = 2,
CP_TYPE_AIR_NORMAL                        = 3,
CP_TYPE_AIR_FINISH                        = 4,
CP_TYPE_AIR_ROTATING                      = 5,
CP_TYPE_AIR_STROBING                      = 6,
CP_TYPE_AIR_SWINGING                      = 7,
CP_TYPE_AIR_BOBBING                        = 8
}

(2024-01-06, 12:32 AM)Mido Wrote: 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, ...);

??? just search for the right checkpoint type
  Reply
#4
You don't have to be doing all of that. But I appreciate you pointing that out.
  Reply
#5
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;
GetVehicleParamsEx(vehID, 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;
GetVehicleParamsEx(vehID, engine, lights, alarm, doors, bonnet, boot, objective);

Similar with the old "Float" declaration from the old a_samp library.

Many thanks!
  Reply


Forum Jump: