SA-MP Forums Archive
warning 203: symbol is never used - 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: warning 203: symbol is never used (/showthread.php?tid=414281)



warning 203: symbol is never used - blackdragon1 - 08.02.2013

warning 203: symbol is never used: "difference"?

PHP код:
 new difference 



Re : warning 203: symbol is never used - yusei - 08.02.2013

add to your script

#pragma unused difference


Re: warning 203: symbol is never used - blackdragon1 - 08.02.2013

now i got it

(51) : error 017: undefined symbol "difference"
(21190) : warning 203: symbol is never used: "difference"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Error.


line 51 is ur script and 2nd mine old.


Re: Re : warning 203: symbol is never used - Bicentric - 08.02.2013

Quote:
Originally Posted by yusei
Посмотреть сообщение
add to your script

#pragma unused difference
Don't just tell him what to do, explain to him what the problem is.

Basically, the script your using has a variable which is used to store a type of data, that warning simply means that you've made it, but you're not using it anywhere yet.

Yes doing

pawn Код:
#pragma unused difference
But when it comes to the time when you need to use it, you will get warnings, so once you get a undefined error warning, simply remove that directive and you should be okay. The directive is that code above.


Re: warning 203: symbol is never used - Bicentric - 08.02.2013

Quote:
Originally Posted by blackdragon1
Посмотреть сообщение
now i got it

(51) : error 017: undefined symbol "difference"
(21190) : warning 203: symbol is never used: "difference"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Error.


line 51 is ur script and 2nd mine old.
Could you please copy and post line 51?


Re: warning 203: symbol is never used - Fiore - 08.02.2013

Just remove unused line!? (21190)


Re: warning 203: symbol is never used - blackdragon1 - 08.02.2013

PHP код:
51#pragma unused difference
21190: new difference 
there is full code:

PHP код:
forward AntiCash();
public 
AntiCash()
{
    foreach(
Playeri)
    {
        if(
GetPlayerMoney(i) != PlayerCash[i])
        {
            new 
difference;
            
ResetPlayerMoney(i);
            
GivePlayerMoney(i,PlayerCash[i]);
            return 
1;
        }
    }
    return 
1;




Re: warning 203: symbol is never used - Bicentric - 08.02.2013

Oh I see what has happened here, I cannot remember specifically on how to remove the warning, there is away around it, but remove line 51 for now, you will get your original warning but try and ignore that for now. Hopefully someone will know what the problem is and post it. I've had this MANY times before, but I forget how to remove it.


Re: warning 203: symbol is never used - Fiore - 08.02.2013

pawn Код:
forward AntiCash();
public AntiCash()
{
    foreach(Player, i)
    {
        if(GetPlayerMoney(i) != PlayerCash[i])
        {
            ResetPlayerMoney(i);
            GivePlayerMoney(i,PlayerCash[i]);
            return 1;
        }
    }
    return 1;
}
Remove: 51: #pragma unused difference


Re: warning 203: symbol is never used - Bicentric - 08.02.2013

Okay I have failed, I didn't see that you posted the full code.

To fix all errors, remove line 51, and remove that 'new difference;' in the code.

Fixed:

pawn Код:
forward AntiCash();
public AntiCash()
{
    foreach(Player, i)
    {
        if(GetPlayerMoney(i) != PlayerCash[i])
        {
            ResetPlayerMoney(i);
            GivePlayerMoney(i,PlayerCash[i]);
            return 1;
        }
    }
    return 1;
}