SA-MP Forums Archive
warning help - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: warning help (/showthread.php?tid=633938)



warning help - JuzDoiT - 10.05.2017

warning 202: number of arguments does not match definition

problem is on this line
PHP код:
 "if (IsPlayerInRangeOfActor(playerid, LSAMMU_ACTOR, SFAMMU_ACTOR, LVAMMU_ACTOR))" //cuz i added LVAMMU_ACTOR 
PHP код:
stock InRangeOfAmmuActors(playerid)
{
    if (
IsPlayerInRangeOfActor(playeridLSAMMU_ACTORSFAMMU_ACTORLVAMMU_ACTOR))
    {
        return 
1;
    }
    return 
0;

when i try without LVAMMU_ACTOR it work good

PHP код:
stock InRangeOfAmmuActors(playerid)
{
    if (
IsPlayerInRangeOfActor(playeridLSAMMU_ACTORSFAMMU_ACTOR))
    {
        return 
1;
    }
    return 
0;

here is IsPlayerInRangeOfActor

Quote:

stock IsPlayerInRangeOfActor(playerid, actorid, Float:radius = 3.0)
{
new Float,
Float:y,
Float:z;

if (GetActorPos(actorid, x, y, z))
{
return IsPlayerInRangeOfPoint(playerid, radius, x, y, z);
}
return 0;
}




Re: warning help - Toroi - 10.05.2017

The warning is pretty straightforward, is not it?
Quote:

number of arguments does not match definition

The arguments you must to pass the function is what the function's header tells you to:
PHP код:
IsPlayerInRangeOfActor(playeridactoridFloat:radius 3.0
If what you want to do is to check if the player is near one or more actors, add an 'or' ( || ) separator in that conditional statement and add as many IsPlayerInRangeOfActor functions as you want, complying with the required arguments.

I can't give you an example because the function itself is pretty straightforward, as i said before.


Re: warning help - JuzDoiT - 10.05.2017

nvm , fixed , thanks for the info