Continue; - 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)
+--- Thread: Continue; (
/showthread.php?tid=332802)
Continue; -
HondaCBR - 09.04.2012
Im checking through available slots (ADMV1)
as soon as 1 is available how can I stop checking through the overs?
because they all could be set to 0, so if it finds ADMV1 as 0, it can stop there and not check ADMV2
pawn Код:
if(dini_Int(SettingsFile,"ADMV1") == 0)
{
dini_IntSet(SettingsFile,"ADMV1",PlayerInfo[playerid][pCarSel]);
FacCar2 = 1;
}
if(dini_Int(SettingsFile,"ADMV2") == 0)
{
dini_IntSet(SettingsFile,"ADMV2",PlayerInfo[playerid][pCarSel]);
FacCar2 = 2;
}
if(dini_Int(SettingsFile,"ADMV3") == 0)
{
dini_IntSet(SettingsFile,"ADMV3",PlayerInfo[playerid][pCarSel]);
FacCar2 = 3;
}
if(dini_Int(SettingsFile,"ADMV4") == 0)
{
dini_IntSet(SettingsFile,"ADMV4",PlayerInfo[playerid][pCarSel]);
FacCar2 = 4;
}
I cant use return 1;
as I have code after the checks and it will not get reached.
Re: Continue; -
Jefff - 09.04.2012
Use a loop and break; ?
Re: Continue; -
ViniBorn - 09.04.2012
With ' else if '
pawn Код:
if(dini_Int(SettingsFile,"ADMV1") == 0)
{
dini_IntSet(SettingsFile,"ADMV1",PlayerInfo[playerid][pCarSel]);
FacCar2 = 1;
}
else if(dini_Int(SettingsFile,"ADMV2") == 0)
{
dini_IntSet(SettingsFile,"ADMV2",PlayerInfo[playerid][pCarSel]);
FacCar2 = 2;
}
else if(dini_Int(SettingsFile,"ADMV3") == 0)
{
dini_IntSet(SettingsFile,"ADMV3",PlayerInfo[playerid][pCarSel]);
FacCar2 = 3;
}
else if(dini_Int(SettingsFile,"ADMV4") == 0)
{
dini_IntSet(SettingsFile,"ADMV4",PlayerInfo[playerid][pCarSel]);
FacCar2 = 4;
}