some warnings
#1

I got some warnings on this that i donґt know how to fix.
The first two is in my /Pme CMD

the warning is on
Код:
new giveplayerid = ReturnUser(tmp);
warning 219: local variable "giveplayerid" shadows a variable at a preceding level
Код:
	if(strcmp(cmd, "/pme", true) == 0)
	{
     if(Loggad[playerid] == 1)
	    {
	        tmp = strtok(cmdtext, idx);
	        if(!strlen(tmp))
	        {
	            SCM(playerid, COLOR_WHITE, "USAGE: /Pme <Player ID> <Message>");
	            return 1;
			}
   			new giveplayerid = ReturnUser(tmp);
   			new length = strlen(cmdtext);
			while ((idx < length) && (cmdtext[idx] <= ' '))
			{
				idx++;
			}
			new offset = idx;
			new result[64];
			while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
			{
				result[idx - offset] = cmdtext[idx];
				idx++;
			}
			result[idx - offset] = EOS;
			if(!strlen(result))
	        {
	            SCM(playerid, COLOR_WHITE, "USAGE: /Pme <Player ID> <Message>");
	            return 1;
			}
			if(IsPlayerConnected(giveplayerid))
			{
			    new Text2[355];
			    GetPlayerName(playerid, Spelare, sizeof(Spelare));
			    GetPlayerName(giveplayerid, Spelare2, sizeof(Spelare2));
			    format(Text2, sizeof(Text2), "** Private Message From %s: %s **", Spelare, result);
			    SCM(giveplayerid, COLOR_YELLOW, Text2);
			    format(Text2, sizeof(Text2), "** Private Message Sent to %s: %s **", Spelare2, result);
			    SCM(playerid, COLOR_YELLOW, Text2);
			}
			else{SCM(playerid, COLOR_RED, "MAIN ERROR(That player isn't online!)");}
		}
		return 1;
	}
the next two is wierd. Its my defines. if i remove the two warning lines (43-44)
Код:
#define TEAM_ORANGE_COLOR 0xFF830000
#define TEAM_COR_COLOR 0x39393900
i will still get warnings on 43-44 even if the two lines are replaced with some other defines. why?
Код:
#define COLOR_YELLOW 0xFFFF00AA
#define COLOR_LIGHTBLUE 0x33CCFFAA
#define COLOR_GREEN 0x33AA33AA
#define COLOR_BLUE 0x33CCFFAA
#define c_y 0xFFFF00AA
#define COLOR_DBLUE 0x2641FEAA
#define COLOR_GREY 0xBEBEBEAA
#define COLOR_WHITE 0xFFFFFFAA
#define COLOR_RED 0xAA3333AA
#define SCM SendClientMessage
#define GameLanguageText
#define GGameTextForAll
#define TEAM_CYAN 1
#define TEAM_BLUE 2
#define TEAM_GREEN 3
#define TEAM_ORANGE 4
#define TEAM_COR 5
#define TEAM_BAR 6
#define TEAM_TAT 7
#define TEAM_CUN 8
#define TEAM_STR 9
#define TEAM_HIT 10
#define TEAM_ADMIN 11
#define TEAM_GREEN_COLOR 0xFFFFFFAA
#define TEAM_JOB_COLOR 0xFFB6C1AA
#define TEAM_HIT_COLOR 0xFFFFFF00
#define TEAM_BLUE_COLOR 0x8D8DFF00
#define TEAM_GROVE_COLOR 0x00D900C8
#define TEAM_VAGOS_COLOR 0xFFC801C8
#define TEAM_BALLAS_COLOR 0xD900D3C8
#define TEAM_AZTECAS_COLOR 0x01FCFFC8
#define TEAM_CYAN_COLOR 0xFF8282AA
#define TEAM_ORANGE_COLOR 0xFF830000
#define TEAM_COR_COLOR 0x39393900
#define TEAM_BAR_COLOR 0x00D90000
#define TEAM_TAT_COLOR 0xBDCB9200
#define TEAM_CUN_COLOR 0xD900D300
#define TEAM_STR_COLOR 0x01FCFF00
#define TEAM_ADMIN_COLOR 0x00808000
Reply


Messages In This Thread
some warnings - by cruising - 28.08.2010, 16:39
Re: some warnings - by Jefff - 28.08.2010, 16:41
Re: some warnings - by cruising - 28.08.2010, 16:46
Re: some warnings - by marharth - 28.08.2010, 16:50
Re: some warnings - by cruising - 28.08.2010, 16:57
Re: some warnings - by Souvlaki - 28.08.2010, 17:00
Re: some warnings - by Adil - 28.08.2010, 17:09
Re: some warnings - by cruising - 28.08.2010, 17:15
Re: some warnings - by Souvlaki - 28.08.2010, 17:18
Re: some warnings - by cruising - 28.08.2010, 17:29

Forum Jump:


Users browsing this thread: 1 Guest(s)