Warning - Will +REP
#1

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;
}
Reply
#2

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

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

Give us the line that the error is located at.
Reply
#5

try it now
public OnGameModeExit()
{

KillTimer(ClockTimer);
db_close(Database);
return 1;
}
Reply
#6

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

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

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;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)