symbol is assigned a value that is never used
#1

What Happens?

EJEMPLE:
pawn Code:
#include <a_samp>

#define valor (20)
new valores;

public OnFilterScriptInit()
{
    valores = valor; //warning 204: symbol is assigned a value that is never used: "valores"
    return 1;
}

public OnPlayerConnect(playerid) //Ejemple
{
    GivePlayerMoney(playerid, 2*valor); //Ejemple
    return 1;
}
Thanks in advance

sorry for my English.
Reply
#2

You assign to valores a value of 20, but you don't use it anywhere to your script. Use it somewhere or just delete it becasue it's pointless.
Reply
#3

pawn Code:
#include <a_samp>

#define valor (20)
new valores;

public OnFilterScriptInit()
{
    valores = valor; //warning 204: symbol is assigned a value that is never used: "valores"
    return 1;
}

public OnPlayerConnect(playerid) //Ejemple
{
    GivePlayerMoney(playerid, 2*valores); //<------
    return 1;
}
I was getting bad XD
Reply
#4

In my opinion, it's still pointless though. You can just do.
pawn Code:
#include <a_samp>

#define valores 20

public OnFilterScriptInit()
{
    return 1;
}

public OnPlayerConnect(playerid)
{
    GivePlayerMoney(playerid, 2*valores);
    return 1;
}
And you don't need to define a new variable or that.
Reply
#5

Quote:
Originally Posted by Dwane
View Post
In my opinion, it's still pointless though. You can just do.
pawn Code:
#include <a_samp>

#define valores 20

public OnFilterScriptInit()
{
    return 1;
}

public OnPlayerConnect(playerid)
{
    GivePlayerMoney(playerid, 2*valores);
    return 1;
}
And you don't need to define a new variable or that.
not because I want to create a command to change the value of 'values​​' and 'define' does not work.
Reply
#6

Quote:
Originally Posted by bytytus
View Post
not because I want to create a command to change the value of 'values​​' and 'define' does not work.
because all the define does is replace any occurrences of the identifier (valores) with 20. and the reason why you can't change the value is because valores is treated as a const value (plus it doesn't exist in memory, how are you expecting to access it?)

just create a variable, initialize it with what-ever value and then use it.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)