Hallo
ich habe 5 warnigs wegen count
new count;
die cods wo es vorkommt
if(strcmp(strget(cmdtext,0),"/wanted", true, 10) == 0)
{
if(IsPlayerConnected(playerid))
{
if(gTeam[playerid] == 1 || IsACop(playerid))
{
if(OnDuty[playerid] == 1)
{
new tmp2[200],tmp3[200];
tmp = strget(cmdtext,1);
tmp2 = strget(cmdtext,2);
tmp3 = strget(cmdtext,2);
if(!strlen(tmp) || !strlen(tmp2) || !strlen(tmp3))
{
SendClientMessage(playerid, COLOR_WHITE, "FEHLER: /wanted [playerid][wantedlevel][Grund]");
return 1;
}
giveplayerid = ReturnUser(tmp);
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
if (ProxDetectorS(8.0, playerid, giveplayerid))
{
if(giveplayerid == playerid)
{
SendClientMessage(playerid, COLOR_GREY, "Du dir nicht selbst wanteds geben!");
return 1;
}
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* Du hast %s Wanteds gekricht von %s(ID:%d)(Grund:%s).",tmp2, sendername, playerid, cmdtext[3]);
SendClientMessage(giveplayerid, COLOR_RED, string);
format(string, sizeof(string), "Du hast %s(ID:%d) Wanteds(%s) gegeben.", giveplayer, playerid, tmp2);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
new stern = strval(strget(cmdtext,2));
new wanteds = GetPlayerWantedLevel(playerid);
SetPlayerWantedLevel(giveplayerid,wanteds+stern);
WantedPoints[giveplayerid] = stern;
count = 1;
if(WantedLevel[giveplayerid] > 6)
{
SetPlayerWantedLevel(giveplayerid,6);
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Spieler ist nicht in deiner Nähe!");
return 1;
}
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, "Dieser Spieler ist Offline !");
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Du bist nicht im Dienst(/job)");
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, "Du bist kein Polizist!");
}
}
return 1;
}
if(newstate == PLAYER_STATE_WASTED)
{
if(WantedLevel[playerid] > 0)
{
new price = WantedLevel[playerid] * 100;
new string[200];
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(IsACop(i) && CrimInRange(30.0, playerid,i))
{
count = 1;
format(string, sizeof(string), "~w~Gesuchten umgebracht~n~Bonus: ~g~$%d", price);
GameTextForPlayer(i, string, 5000, 1);
ConsumingMoney[i] = 1;
GivePlayerMoney(i, price);
PlayerPlaySound(i, 1058, 0.0, 0.0, 0.0);
}
}
}
if(count == 1)
{
GivePlayerMoney(playerid, - price);
pDaten[playerid][WantedDeaths] += 1;
pDaten[playerid][Jailed] = 1;
pDaten[playerid][Jailtime] = (WantedLevel[playerid] * 600);
ResetPlayerWeapons(playerid);
SetPlayerInterior(playerid, 3);
if(LSPDZellen == 0)//zelle1
{
SetPlayerPos(playerid,198.58247375,162.02970886,1002.67919922);
LSPDZellen += 1;
}
if(LSPDZellen == 1)//zelle4
{
SetPlayerPos(playerid,197.29866028,175.16213989,1002.67266846);
LSPDZellen += 1;
}
if(LSPDZellen == 2)//zelle5
{
SetPlayerPos(playerid,193.21949768,175.11158752,1002.67266846);
LSPDZellen = 0;
}
WantedPoints[playerid] = 0;
SetPlayerWantedLevel(playerid,0);
format(string, sizeof(string), "Du bist für %d Sekunden im Gefängnis und musst $%d bezahlen.", pDaten[playerid][Jailtime], price);
SendClientMessage(playerid, COLOR_LIGHTRED, string);
WantedLevel[playerid] = 0;
unjailtimer = SetTimer("SetPlayerUnjail", 1000, 1);
count = 0;
}
}
}
So da kommt es vor was da falsch das die warnings kommen
pawno\include\dutils.inc(288) : warning 219: local variable "count" shadows a variable at a preceding level
pawno\include\dutils.inc(307) : warning 219: local variable "count" shadows a variable at a preceding level
pawno\include\dutils.inc(325) : warning 219: local variable "count" shadows a variable at a preceding level
pawno\include\M_Bot.inc(469) : warning 219: local variable "count" shadows a variable at a preceding level
pawno\include\utils.inc(51) : warning 219: local variable "count" shadows a variable at a preceding level
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
Header size: 6704 bytes
Code size: 422564 bytes
Data size: 703084 bytes
Stack/heap size: 16384 bytes; estimated max. usage=4503 cells (18012 bytes)
Total requirements: 1148736 bytes
5 Warnings.
Alles anzeigen