Problem with this stock
#1

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"
Reply
#2

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

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.
Reply
#4

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.
Reply
#5

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.
Reply
#6

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?
Reply
#7

Yeah
He means that.
Reply
#8

Thanks,fixed,and rep.
Reply
#9

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)