SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help > Help Archive

 
 
Thread Tools Display Modes
Old 08/08/2009, 03:57 PM   #1
PKRanger
Little Clucker
 
Join Date: Jul 2009
Posts: 19
Reputation: 0
Default warning 219: local variable "timecounter" shadows a variable at a preceding leve

error :
\gamemodes\drp.pwn(6 : warning 219: local variable "timecounter" shadows a variable at a preceding level

- TimeCounter is forwarded on top
- For all the strings/constants are new blabla ontop.
Code:
public TimeCounter(playerid, timecounter[])
{
	if (currentstate[playerid] == 0)
	{
	  // beaten time challange!
	  timechallange = timecounter[playerid];
	  KillTimer(timecountertimer[playerid]);
   	timecounter[playerid] = 0;
   	racecheckpoint[playerid] = 0;
   	currentstate[playerid] = 0;
   	return 1;
	  
	}
	else if(timecounter[playerid] > timechallange)
	{
		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
	{
   new str[128];
   format(str, sizeof str, "~b~ %d", timecounter[playerid]);
   GameTextForAll(str, 500, 5);
   timecountertimer[playerid] = SetTimer("TimeCounter", 1000, 0);
   timecounter[playerid]++;
	}
	return 1;
}
What does this exacly meens ?

Somehow i have some issues with this countup function when several people are joining it
PKRanger is offline  
Old 08/08/2009, 03:59 PM   #2
SiJ
Gangsta
 
SiJ's Avatar
 
Join Date: Feb 2009
Location: Lithuania
Posts: 898
Reputation: 9
Default Re: warning 219: local variable "timecounter" shadows a variable at a preceding leve

What line?
Edit it means that you have 2 "new timecounter;"
__________________
Guess who's back...
SiJ is offline  
Old 08/08/2009, 04:01 PM   #3
PKRanger
Little Clucker
 
Join Date: Jul 2009
Posts: 19
Reputation: 0
Default Re: warning 219: local variable "timecounter" shadows a variable at a preceding leve

Quote:
Originally Posted by Justas [SiJ
]
What line?
Edit it means that you have 2 "new timecounter;"

Nope, checked it out..
PKRanger is offline  
Old 08/08/2009, 04:04 PM   #4
PKRanger
Little Clucker
 
Join Date: Jul 2009
Posts: 19
Reputation: 0
Default Re: warning 219: local variable "timecounter" shadows a variable at a preceding leve

new racecheckpoint[MAX_PLAYERS];
new currentstate[MAX_PLAYERS];
// 1 = nos installatie, 2 accepted race, 3 = requester van de race, 4 = spoiler, 5 = Hydralics, 6 = uitgenodigde, 7 = time challange
//new owncar[MAX_PLAYERS];
new challanger[MAX_PLAYERS];
new count = 5;
new tuning[MAX_PLAYERS];
new getrace = 10;
new timecounter[MAX_PLAYERS];
new timechallange = 99;
new timecountertimer[MAX_PLAYERS];
new counttimer;
new gettuningtimer[MAX_PLAYERS];
new getracetimer;
// Global Forwards

forward racecheckpoints (playerid, challanger);
forward RaceClosestPlayer(playerid);
forward Float:GetDistanceBetweenPlayers(p1,p2);
forward CountDown(playerid);
forward TimeCounter(playerid, timecounter[]);
forward GetRace(playerid, targetid);
forward GetNos(playerid);
forward GetSpoiler(playerid);
forward GetHydralics(playerid);
forward Vehiclespawn();
forward timechallanger(playerid);

this is currently on top..
PKRanger is offline  
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
(19879) : warning 219: local variable "mod" shadows a variable at a preceding le ReactionGameServers Help Archive 4 02/03/2010 08:23 PM
[Solved] Shadows variable at preceding level? bajskorv123 Help Archive 2 06/01/2010 10:14 AM
local variable "KillsName" shadows a variable at a preceding level (weird) ғαιιοцт Help Archive 40 14/10/2009 07:04 PM
[Help]error 033: array must be indexed (variable "teleport") borisblat Help Archive 1 13/10/2009 02:51 PM
local variable "tmp2" shadows a variable at a preceding level Battlaman Help Archive 2 04/08/2009 06:10 PM


All times are GMT. The time now is 06:29 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.