Warning - Will +REP - 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 - Will +REP (
/showthread.php?tid=582480)
Warning - Will +REP -
ZachKnoxx - 20.07.2015
How do I fix this warning?
C:\Users\Zach\Desktop\Folders\Servers\SAMP\Server\ gamemodes\rp.pwn(2043) : warning 219: local variable "WT" shadows a variable at a preceding level
Код HTML:
public OnGameModeExit()
{
new WT; // Warning is on this line
KillTimer(ClockTimer);
KillTimer(WT);
db_close(Database);
return 1;
}
Re: Warning - Will +REP -
MBilal - 20.07.2015
Quote:
Originally Posted by ZachKnoxx
How do I fix this warning?
C:\Users\Zach\Desktop\Folders\Servers\SAMP\Server\ gamemodes\rp.pwn(2043) : warning 219: local variable "WT" shadows a variable at a preceding level
Код HTML:
public OnGameModeExit()
{
new WT; // Warning is on this line
KillTimer(ClockTimer);
KillTimer(WT);
db_close(Database);
return 1;
}
|
change to this
Код:
public OnGameModeExit()
{
KillTimer(ClockTimer);
KillTimer(WT);
db_close(Database);
return 1;
}
this mean
warning 219: local variable "WT" shadows a variable at a preceding level
You already using Define WT variable some where in your script.
Re: Warning - Will +REP -
ZachKnoxx - 20.07.2015
I get one error.
Код HTML:
C:\Users\Zach\Desktop\Folders\Servers\SAMP\SamZach\gamemodes\rp.pwn(2045) : error 076: syntax error in the expression, or invalid function call
Re: Warning - Will +REP -
DarkLored - 20.07.2015
Give us the line that the error is located at.
Re: Warning - Will +REP -
MBilal - 20.07.2015
try it now
public OnGameModeExit()
{
KillTimer(ClockTimer);
db_close(Database);
return 1;
}
Re: Warning - Will +REP -
ZachKnoxx - 20.07.2015
Quote:
Originally Posted by MBilal
try it now
public OnGameModeExit()
{
KillTimer(ClockTimer);
db_close(Database);
return 1;
}
|
You removed it. Won't that fuck up the timer?
Re: Warning - Will +REP -
DarkLored - 20.07.2015
Quote:
Originally Posted by ZachKnoxx
You removed it. Won't that fuck up the timer?
|
Create a different variable for the timer then. if you create a global variable and then recreate it in a command then it will cancel itself.
Re: Warning - Will +REP -
MBilal - 20.07.2015
Can you find it Press Crtl+F and find WT where you define it
is it timer or some thing else?
because in this code
public OnGameModeExit()
{
new WT; //you defining variable here and its not timer
KillTimer(ClockTimer);
KillTimer(WT); // you killing variable which is not timer
db_close(Database);
return 1;
}