1 Warning need help
#1

hmm i tried everything and i cannot fix this lol ....
so here is the warning
pawn Код:
.pwn(172) : warning 203: symbol is never used: "playerid"
and here is the warning line
pawn Код:
stock CheckAimingRobNPC(playerid)
Reply
#2

Can you check us the code where that line is included?
Reply
#3

You use "playerid" as parameter there but you don't actually use it.

An example of what you've done:
pawn Код:
stock SayHello(playerid)
{
    print("Hello");
}
It uses playerid as parameter but it doesn't use it inside the function.
Reply
#4

Damn i don't get it, -_-
here is all the line ,
may you show me how i fix this ?
pawn Код:
stock CheckAimingRobNPC(playerid)
{
    new targetplayer;

    for (new x = 1; x <= npcnum; x++)
    {
        if(targetplayer == robnpc[x])
        {
            return robnpc[x];
        }
    }

    return INVALID_PLAYER_ID;
}
Reply
#5

Surely just change:

pawn Код:
stock CheckAimingRobNPC(playerid)
to
pawn Код:
stock CheckAimingRobNPC(targetplayer)
Good luck!
Reply
#6

Why do you declare a new variable that it will always be 0 when you can use playerid?

pawn Код:
stock CheckAimingRobNPC(playerid)
{
    for (new x = 1; x <= npcnum; x++)
    {
        if(playerid == robnpc[x])
        {
            return robnpc[x];
        }
    }
   
    return INVALID_PLAYER_ID;
}
Quote:
Originally Posted by PrivatioBoni
Посмотреть сообщение
Surely just change:

pawn Код:
stock CheckAimingRobNPC(playerid)
to
pawn Код:
stock CheckAimingRobNPC(targetplayer)
Good luck!
No, that will give warning 219: local variable "targetplayer" shadows a variable at a preceding level and another warning that "targetplayer" is never used.
Reply
#7

Are you using the function, or is it just being made?

Provide the code where you're calling it as well.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)