Don't get it.
#1

Hey everyone,

I'm making interior enter/exits and can anyone say why I get this warning?

pawn Код:
warning 202: number of arguments does not match definition
This is the line:
pawn Код:
if (PlayerToPoint(2, playerid,-217.8443,979.1246,19.5040,102.9833)) { SetPlayerPos(playerid,246.783996,63.900199,1003.640625); SetPlayerInterior(playerid, 6);}
I tried doing it like:
pawn Код:
if (PlayerToPoint(2, playerid,-217.8443,979.1246,19.5040,102.9833)) //THIS Is THE LINE WHERE I GET WARNING
{
      SetPlayerPos(playerid,246.783996,63.900199,1003.640625);
      SetPlayerInterior(playerid, 6);
}
But still get the same warning, everything works, but it's very annoying to see warning when compiling.
Can anyone help me?

P.S. everywhere else PlayerToPoint works perfectly.
Reply
#2

It means that you are either using too little or too many arguments in that function, that function as far as I know requires just 5 arguments, you have put in 6 arguments. The last one looks like the angle, which is not useful in this function anyway, so remove that argument!
Reply
#3

This is because you have included a extra argument which is not needed, which I guess is facing angle and it's not needed like I mentioned.
pawn Код:
if (PlayerToPoint(2, playerid,-217.8443,979.1246,19.5040))
Reply
#4

Oh my god, that's right. ;O Thanks, I didn't saw that. ;]

it help on some lines, but still gives it on this:
pawn Код:
if (PlayerToPoint(2, playerid, 246.7839, 63.9001, 1003.6406))
and some other. What's wrong with this line?
Reply
#5

Quote:
Originally Posted by Dirkon
Посмотреть сообщение
Oh my god, that's right. ;O Thanks, I didn't saw that. ;]

it help on some lines, but still gives it on this:
pawn Код:
if (PlayerToPoint(2, playerid, 246.7839, 63.9001, 1003.6406))
and some other. What's wrong with this line?
This line looks good in my eyes. What warning it gives anyways?
Reply
#6

Yeah it should be good, but somewhy it isn't. It gives the same warning:
pawn Код:
(1022) : warning 202: number of arguments does not match definition
Reply
#7

Why do people still use outdated functions when there are far better alternatives available; IsPlayerInRangeOfPoint.
Reply
#8

I don't get it, even if I use IsPlayerInRangeOfPoint I get the same warning..
pawn Код:
if(IsPlayerInRangeOfPoint(playerid, 7.0, 246.7839, 63.9001, 1003.6406)) { SetPlayerPos(playerid,-217.8443,979.1246,19.5040,102.9833); SetPlayerInterior(playerid, 0);}
SOLVED
Reply
#9

This is your solution:

pawn Код:
if(IsPlayerInRangeOfPoint(playerid, 7.0, 246.7839, 63.9001, 1003.6406)) { SetPlayerPos(playerid,-217.8443,979.1246,19.5040);SetPlayerFacingAngle( playerid,102.9833); SetPlayerInterior(playerid, 0);}
Edit: SetPlayerPosition is only for "the position", SetPlayerFacingAngle is for the angle.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)