open.mp forum
[Pawn] Error on weapon-config.inc - 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] Error on weapon-config.inc (/showthread.php?tid=1251)



Error on weapon-config.inc - DaZzY - 2020-10-16

Hello?

i want use the include weapon config to make a damage informer but i get this error:?



Quote:weapon-config.inc(1589) : error 035: argument type mismatch (argument 2)



how to fix it please ?


RE: Error on weapon-config.inc - Kwarde - 2020-10-16

argument type mismatch means, well, that the argument type mismatched :P

Example of an argument mismatch:



Code:
Foo(a, b);

main() printf("%d", Foo(1, "2"));

As you can see, Foo() expects the second argument to be a tagless integer. I used a string ("2" rather than 2). This will result in the error you've shown.



Check that line in weapon-config.inc and check the second argument, and then check the function it's mismatched in to see what it's supposed to be.

Might be you did something wrong too (since most people don't have that issue with weapon-config.inc).


RE: Error on weapon-config.inc - DaZzY - 2020-10-16

AH okey :D but how can i find the line of problem exactly on INCLUDE

Because i don't think the error message give the line when i open inc and searching line (1589) i get this : return ApplyAnimation(playerid, animlib, animname, fDelta, loop, lockx, locky, freeze, time, forcesync); so i don't think problem is on this line


RE: Error on weapon-config.inc - Kwarde - 2020-10-17

The declaration of that native function in a_players.inc is:

Code:
native ApplyAnimation(playerid, animlib[], animname[], Float:fDelta, loop, lockx, locky, freeze, time, forcesync = 0);

Is it possible that the arguments in that function inside weapon-config.inc are using constant arguments? (eg. const animlib[] and const animname[])? If so that very well might be the issue.


RE: Error on weapon-config.inc - DaZzY - 2020-10-21

Yes they are constant
Quote:stock WC_ApplyAnimation(playerid, const animlib[], const animname[], Float:fDelta, loop, lockx, locky, freeze, time, forcesync = 0)
{
if (playerid < 0 || playerid >= MAX_PLAYERS || s_IsDying[playerid]) {
return 0;
}

return ApplyAnimation(playerid, animlib, animname, fDelta, loop, lockx, locky, freeze, time, forcesync);
}




RE: Error on weapon-config.inc - DaZzY - 2020-10-21

UP :D


RE: Error on weapon-config.inc - Pinch - 2020-10-21

Use sampctl or manually download samp-stdlib and pawn-stdlib from pawn-lang github!


RE: Error on weapon-config.inc - Grate Maharlika - 2020-10-22

(2020-10-21, 10:09 PM)Pinch Wrote: Use sampctl or manually download samp-stdlib and pawn-stdlib from pawn-lang github!



Maybe u can help me here please?

https://burgershot.gg/showthread.php?tid=1263