loose indentation and functions
#1

\gamemodes\drp.pwn(70) : warning 219: local variable "timecounter" shadows a variable at a preceding level
\gamemodes\drp.pwn(7 : warning 217: loose indentation


I have about 20 warnings with loose identation, so im trying to solve them..
but every attempt failed..

Код:
forward TimeCounter(playerid, timecounter[]); <-- is on top of the script

public TimeCounter(playerid, timecounter[]) <-- Line 70
{
	if (currentstate[playerid] == 0)
	{
	  // beaten time challange!
	  timechallange = timecounter[playerid];
	  KillTimer(timecountertimer[playerid]);
	}
  if(timecounter[playerid] > 99) <-- line 78
  {
   GameTextForPlayer(playerid,"~g~ You failed to beat the time challange!", 5000, 5);
   KillTimer(timecountertimer[playerid]);
What does the warning exacly meen ? and what are the best way's to solve them ?

thnx,

PKR

Edit:

Код:
forward TimeCounter(playerid, timecounter[]); <-- is on top of the script
public TimeCounter(playerid)

{
	if (currentstate[playerid] == 0)
	{
	  // beaten time challange!
	  timechallange = timecounter[playerid];
	  KillTimer(timecountertimer[playerid]);
	}
  if(timecounter[playerid] > 99)
  {
   GameTextForPlayer(playerid,"~g~ You failed to beat the time challange!", 5000, 5);
   KillTimer(timecountertimer[playerid]);
   timecounter[playerid] = 0;
   racecheckpoint[playerid] = 0;
   currentstate[playerid] = 0;
   return 1;
  }
  else
This way i used to use, is the warning at line 70 gone, but on line 78 is still there.
I have some issues with the script, i suspect they are caused by those little warnings
Reply
#2

For the first warning search for 'new timecounter' and make sure it's only one in the script.
For the second warning make sure that '}' and 'if' are in the same row
Reply
#3

Seems to get fixed, im moving them all.

Ill reply again, if some doesnt.

Thnx
Reply
#4

pawn Код:
KillTimer(timecountertimer[playerid]);
  }
  if(timecounter[playerid] > 99) <-- line 78
  {
and not like
pawn Код:
KillTimer(timecountertimer[playerid]);
      }
  if(timecounter[playerid] > 99) <-- line 78
  {
And for timecounter, just change timecounter to timecount or something in your script. Maybe it's already a variable in include or somewhere.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)