30.07.2014, 23:21
why i get this warning everything seems alright
line 8481
line 8587
PHP код:
C:\Users\Elvis JR\Desktop\CNR-rp\gamemodes\1.2.pwn(8481) : warning 219: local variable "rand" shadows a variable at a preceding level
C:\Users\Elvis JR\Desktop\CNR-rp\gamemodes\1.2.pwn(8587) : warning 219: local variable "rand" shadows a variable at a preceding level
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
2 Warnings.
PHP код:
if(RobbingInfo[i][pRecently69cent] == 1)
{
new ID;
new string[120];
new rand= random(10000);
format(string, 120, ""COL_GREY"["COL_LRED"ROBBERY"COL_GREY"]"COL_YTUNA" %s "COL_WHITE"has robbed $%d from the 69 Cent Store in idlewood.", PlayerInfo(i), rand);
SendClientMessageToAll(0xFFFFFFFF, string);
RobbingInfo[i][pRecently69cent] = 0;
if(gTeam[ID] == Team_Cop || gTeam[ID] == Team_Army || gTeam[ID] == Team_FBI || gTeam[ID] == Team_Guard)
{
format(string, 120, "[DISPATCH] %s has robbed the Los Santos 69 Cent Store in LS idlewood. Respond now.", PlayerInfo(i));
SendCopMessage(string);
return 0;
}
IncreaseWantedLevelNM(i, 6);
GivePlayerMoney(i, rand);
if(IsPlayerAttachedObjectSlotUsed(i, i)) RemovePlayerAttachedObject(i, i);
PlayerTextDrawHide(i, BANKR[i]);
IncreaseScore(i, 2);
AccountInfo[i][pRobSkill] += 1;
format(string, 120, "[SKILL UPGRADE] Your robbing skill has increased. Read /robjob.");
SendClientMessage(i, COLOR_GREY, string);
}
if(RobbingInfo[i][pRobbed69cent] >= 1)
{
--RobbingInfo[i][pRobbed69cent];
}
PHP код:
if(AccountInfo[i][pRobbingBank] > 1)
{
new string[45];
--AccountInfo[i][pRobbingBank];
format(string, sizeof(string), "~y~[~r~BANK ROBBERY~y~] ~n~ ~w~%d", AccountInfo[i][pRobbingBank]);
PlayerTextDrawSetString(i,BANKR[i],string);
PlayerTextDrawShow(i, BANKR[i]);
SetPlayerAttachedObject(i,0,1550,1,0.122000,-0.249000,0.057000,-4.899999,42.100002,134.699966,1.000000,1.000000,1.000000);
}
if(AccountInfo[i][pRobbingBank] == 1)
{
new string[120];
new tdstring[130];
new rand = random(10000);
format(string, 120, "[BANK ROBBERY] %s has robbed $%d from the Los Santos bank.", PlayerInfo(i), rand);
SendClientMessageToAll(COLOR_LIGHTBLUE, string);
CNR_PrintString(string);
GivePlayerMoney(i, rand);
IncreaseScore(i, 3);
format(tdstring, sizeof(tdstring), "~g~+~g~~h~$~g~~h~~h~~h~%d", rand);
PlayerTextDrawSetString(i, WMoney[i], tdstring);
PlayerTextDrawShow(i, WMoney[i]);
SetTimer("HideWM", 7000, 0);
format(string, 120, "[DISPATCH] %s has robbed the Los Santos Bank. Respond now.", PlayerInfo(i));
SendCopMessage(string);
format(string, 120, "Type /radiooff to turn your radio off and stop recieving alerts.");
SendCopMessage(string);
if(IsPlayerAttachedObjectSlotUsed(i, i)) RemovePlayerAttachedObject(i, i);
PlayerTextDrawHide(i, BANKR[i]);
AccountInfo[i][pRobbingBank] = 0;
if(AccountInfo[i][pRobSkill] <= 3)
{
AccountInfo[i][pRobSkill] += 2;
format(string, 120, "[SKILL UPGRADE] Your robbing skill has increased. Read /robjob.");
SendClientMessage(i, COLOR_GREY, string);
}
}
if(AccountInfo[i][pBankRobbed] > 1)
{
--AccountInfo[i][pBankRobbedRecently];
}
}
}
return 1;
}