warniiiing Help Me Pls
#1

Hi.This Is My code :
Код:
public waitrob()
{
    new robpossible;
    robpossible = 1;
}
Give Me This Warning:

Код:
warning 204: symbol is assigned a value that is never used: "taskhirpossible"
What Can Id Do Help Me Tnx :Xx
Reply
#2

It's because you define it, set a value in it, but it's never used.

Why create a variable and store a value in it if it won't get used anywhere to do something with it?

Either use the variable in an if-statement or whatever, or remove it.

It's like buying a coffee machine (new coffeemachine, using it to make coffee (coffeemachine = 1), and never drink to coffee you just made (if (coffeemachine == 1) SendClientMessage(playerid, -1 "You're drinking the coffee").
It's a waste.
Reply
#3

Quote:
Originally Posted by PowerPC603
Посмотреть сообщение
It's because you define it, set a value in it, but it's never used.

Why create a variable and store a value in it if it won't get used anywhere to do something with it?

Either use the variable in an if-statement or whatever, or remove it.
How To Do Is? Pls Give Me Example I Rep You :Xx
Reply
#4

pawn Код:
public waitrob()
{
    new robpossible;
    robpossible = 1;

    if (robpossible == 1)
    {
        SendClientMessageToAll(-1, "Robbing is possible");
    }
}
In this example, you're using the "robpossible" in an if-statement to do something with it, like send a message to all players.
Now the variable is "used" and you won't get that warning anymore.
Reply
#5

How are you defining it as robpossible and the warning is.
Код:
warning 204: symbol is assigned a value that is never used: "taskhirpossible"
This warning has nothing to do with this line, however that variable is not used, use it in a simple if statement as explained above ^
Reply
#6

Quote:
Originally Posted by DaniceMcHarley
Посмотреть сообщение
How are you defining it as robpossible and the warning is.
Код:
warning 204: symbol is assigned a value that is never used: "taskhirpossible"
This warning has nothing to do with this line, however that variable is not used, use it in a simple if statement as explained above ^
Tnx Fixed This :Xx
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)