Don't get it. -
Dirkon - 09.08.2011
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.
Re: Don't get it. -
JaTochNietDan - 09.08.2011
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!
Re: Don't get it. -
admantis - 09.08.2011
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))
-
Dirkon - 09.08.2011
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?
Re: Don't get it. -
admantis - 09.08.2011
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?
Re: Don't get it. -
Dirkon - 09.08.2011
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
Re: Don't get it. -
Vince - 09.08.2011
Why do people still use outdated functions when there are far better alternatives available;
IsPlayerInRangeOfPoint.
Re: Don't get it. -
Dirkon - 09.08.2011
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
Re: Don't get it. -
OwlCity - 09.08.2011
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.