SA-MP Forums Archive
Problem with this stock - 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: Problem with this stock (/showthread.php?tid=310636)



Problem with this stock - Face9000 - 13.01.2012

pawn Код:
stock RandomGift(playerid)
{
    new randomgift = random(MAX_RANDOM_GIFTS) + 1;
    switch (randomgift)
    {
        case 1:
        {
            //
        }
        case 2:
        {
            //
        }
        case 3:
        {
            //
        }
    }
    return 1;
}
warning 203: symbol is never used: "playerid"


Re: Problem with this stock - §с†¶e®РµРe - 13.01.2012

Ah.this is just a warning.no problems will be in your script


Re: Problem with this stock - Wesley221 - 13.01.2012

Thats just because you didnt use the 'playerid'. If you gonna give a random gift to someone, for example 500 gold, youre using the 'playerid' and wont get this warning anymore.


Re: Problem with this stock - Face9000 - 13.01.2012

Well,i dont want to have any warnings/errors in my gamemode.

EDIT:

Quote:

Thats just because you didnt use the 'playerid'. If you gonna give a random gift to someone, for example 500 gold, youre using the 'playerid' and wont get this warning anymore.

It's a stock to give random gift when a player enter vehicle.


Re: Problem with this stock - JamesC - 13.01.2012

This is because the stock isn't complete since you're not using the value of playerid in any way. Once you finish it, there will be no warnings.


Re: Problem with this stock - Face9000 - 13.01.2012

Quote:
Originally Posted by JamesC
Посмотреть сообщение
This is because the stock isn't complete since you're not using the value of playerid in any way. Once you finish it, there will be no warnings.
You mean i'm not using in the "case" releated to stock,right?


Re: Problem with this stock - §с†¶e®РµРe - 13.01.2012

Yeah
He means that.


Re: Problem with this stock - Face9000 - 13.01.2012

Thanks,fixed,and rep.


Re: Problem with this stock - Gh05t_ - 13.01.2012

Quote:
Originally Posted by ******
Посмотреть сообщение
Can I ask an honest question - what about that warning message was confusing or misleading? I've always seen them as quite self-explanatory, the message says that a variable is never used and in fact yes, that variable is never used. It's interesting from a language development point of view to know why people don't understand things (although I didn't make PAWN).
Though being as quite explanatory as they are, the mind of a person who doesn't relate to alternate programming languages and is most notably new to pawn may become baffled, disregarding his post count and amount of time subjected to the forum.