Continue;
#1

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.
Reply
#2

Use a loop and break; ?
Reply
#3

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;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)