Help with too long line
#1

Код:
if(vehicleid == YVozilo[0] || vehicleid == YVozilo[1] || vehicleid == YVozilo[2] || vehicleid == YVozilo[3] || vehicleid == YVozilo[4] || vehicleid == YVozilo[5] || vehicleid == YVozilo[6] || vehicleid == YVozilo[7] || vehicleid == YVozilo[8] || vehicleid == YVozilo[9] || vehicleid == YVozilo[10] || vehicleid == YVozilo[11] || vehicleid == YVozilo[12] || vehicleid == YVozilo[13] || vehicleid == YVozilo[14] || vehicleid == YVozilo[15] || vehicleid == YVozilo[16] || vehicleid == YVozilo[17] || vehicleid == YVozilo[18] || vehicleid == YVozilo[19] || vehicleid == YVozilo[20] || vehicleid == YVozilo[21])
This line is too long how to change it in 2 lines? I tried with \ but not working
Reply
#2

pawn Код:
stock IsYVozilo(vehicleid)
{
    for(new i = 0; i < 22; i++)
        if(vehicleid == YVozilo[i]) return 1;
       
    return 0;
}

// your condition
if(IsYVozilo(vehicleid))
Reply
#3

Thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)