• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Pawn] Error on weapon-config.inc
#1
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 ?
  Reply
#2
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).
  Reply
#3
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
  Reply
#4
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.
  Reply
#5
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);
}

  Reply
#6
UP :D
  Reply
#7
Use sampctl or manually download samp-stdlib and pawn-stdlib from pawn-lang github!
Using Pawn.CMD?

If you're doing so, this is the very first sign that you absolutely shouldn't utilize your all powerful P-Code knowledge in any of the scripting discussion topics.
  Reply
#8
(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
  Reply


Forum Jump: