Hallo Community,
ich hab Heute morgen "versucht" einen Job zu erstellen in dem man Pizza's verkaufen kann.
Nur hab ich ein Problem bzw. ein Warning wo ich nichts richtig damit anzufangen weis.
ZitatC:\Users\David\Documents\ICQ\471189837\ReceivedFiles\264277 Fabi\gf.pwn(32652) : warning 225: unreachable code
if(strcmp(cmd,"/sellpizza",true)==0)
{
if(IsPlayerConnected(playerid))
{
if (PlayerInfo[playerid][pJob] != 19)
{
SendClientMessage(playerid,COLOR_GREY," Du bist kein Pizza Dienst!");
return 1;
}
new pizzaname[256];
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GREEN, "________________________________________________");
SendClientMessage(playerid, COLOR_WHITE, "*** Pizza ***");
SendClientMessage(playerid, COLOR_GREY, "Benutze: /sellpizza [Playerid] [Pizzaname]");
SendClientMessage(playerid, COLOR_GREEN, "________________________________________________");
return 1;
}
giveplayerid = ReturnUser(tmp);
if (IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
pizzaname = strtok(cmdtext, idx);
if(!strlen(pizzaname))
{
SendClientMessage(playerid, COLOR_GREEN, "________________________________________________");
SendClientMessage(playerid, COLOR_WHITE, "*** Pizza ***");
SendClientMessage(playerid, COLOR_GREY, "Benutze: /sellpizza [Playerid] [Pizzaname]");
SendClientMessage(playerid, COLOR_GREY, "Pizzen: Salami Funghi Calzone");
SendClientMessage(playerid, COLOR_GREEN, "________________________________________________");
return 1;
}
}
if(strcmp(pizzaname,"Salami",true) == 0) { return 1; }
else if(strcmp(pizzaname,"Funghi",true) == 0) { return 1; }
else if(strcmp(pizzaname,"Calzone",true) == 0) { return 1; }
else { SendClientMessage(playerid,COLOR_GREY,"Falsche Pizzaname!"); return 1; }
if(ProxDetectorS(5.0, playerid, giveplayerid)) // <<<<<<< Zeile vom Warning <<<<<<<
{
if(giveplayerid == playerid)
{
SendClientMessage(playerid, COLOR_GRAD1, " Du kannst dir nicht selber Pizzen Verkaufen!");
return 1;
}
ConsumingMoney[playerid] = 1;
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), " Du hast %s, eine Pizza %s verkauft.", giveplayer,pizzaname);
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
SendClientMessage(playerid, COLOR_GRAD1, string);
format(string, sizeof(string), " Du hast eine Pizza %s von %s gekauft.", pizzaname, sendername);
SendClientMessage(giveplayerid, COLOR_GRAD1, string);
PlayerPlaySound(giveplayerid, 1052, 0.0, 0.0, 0.0);
format(string, sizeof(string), "* %s verkauft an %s eine Pizza.", sendername ,giveplayer);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " Der Spieler ist zu weit weg!");
return 1;
}
}
else
{
format(string, sizeof(string), " %d ist kein aktiver Spieler.", giveplayerid);
SendClientMessage(playerid, COLOR_GRAD1, string);
}
}
return 1;
}
Ich hoffe jemand kann mir Helfen.
MfG HEiTZER