unreachable code warning - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: unreachable code warning (
/showthread.php?tid=266492)
unreachable code warning -
Jack_Leslie - 05.07.2011
I get the unreachable code warning on this code:
Код:
if(IsPlayerInRangeOfPoint(playerid,1.5,1248.038940, -1559.942993, 13.563451)) //vip club
{
if(PlayerInfo[playerid][pDonateRank] >= 1)
{
SetPlayerInterior(playerid,17);
SetPlayerVirtualWorld(playerid,30);
SetPlayerPos(playerid,493.390991,-22.722799,1000.679687);
GameTextForPlayer(playerid, "~w~The VIP Club", 5000, 1);
return 1;
}
else
{
SetPlayerInterior(playerid,0);
SetPlayerPos(playerid,1248.038940, -1559.942993, 13.563451);
SendClientMessage(playerid,COLOR_YELLOW,"You're not a VIP loser!");
return 1;
}
return 1;
}
Please fix it
Re: unreachable code warning - Deskoft - 05.07.2011
pawn Код:
if(IsPlayerInRangeOfPoint(playerid,1.5,1248.038940, -1559.942993, 13.563451)) //vip club
{
if(PlayerInfo[playerid][pDonateRank] >= 1)
{
SetPlayerInterior(playerid,17);
SetPlayerVirtualWorld(playerid,30);
SetPlayerPos(playerid,493.390991,-22.722799,1000.679687);
GameTextForPlayer(playerid, "~w~The VIP Club", 5000, 1);
return 1;
}
else
{
SetPlayerInterior(playerid,0);
SetPlayerPos(playerid,1248.038940, -1559.942993, 13.563451);
SendClientMessage(playerid,COLOR_YELLOW,"You're not a VIP loser!");
return 1;
}
}
Re: unreachable code warning -
Jack_Leslie - 05.07.2011
Thankyou!
Re: unreachable code warning -
Bakr - 05.07.2011
Remove the return 1's from the statements, as they're unnecessary.
P.S. It's a shame someone actually made it for you.