SA-MP Forums Archive
Shorten help - 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: Shorten help (/showthread.php?tid=381736)



Shorten help - basse - 30.09.2012

i forgot how to shorten a line can somebody please shorten this for me

pawn Код:
if(CarCheck == Cars[p1] || CarCheck == Cars[p2] || CarCheck == Cars[p3] || CarCheck == Cars[p4] || CarCheck == Cars[p5] || CarCheck == Cars[p6] || CarCheck == Cars[p7] || CarCheck == Cars[p8] || CarCheck == Cars[p9] || CarCheck == Cars[p10] || CarCheck == Cars[p11] || CarCheck == Cars[p12] || CarCheck == Cars[p13] || CarCheck == Cars[p14] || CarCheck == Cars[p15] || CarCheck == Cars[p16] || CarCheck == Cars[p17] || CarCheck == Cars[p18] || CarCheck == Cars[p19] || CarCheck == Cars[p20] || CarCheck == Cars[p21] || CarCheck == Cars[p22])



Re : Shorten help - Amine_Mejrhirrou - 30.09.2012

shorten aline ? what u mean ?


Re: Shorten help - basse - 30.09.2012

it is to long, i need it to be smaller but with all the cars in it


Re : Shorten help - Amine_Mejrhirrou - 30.09.2012

try this idk if it gonna work i never tested it
pawn Код:
if(CarCheck == (Cars[p1] || Cars[p2] ||Cars[p3] ||  Cars[p4] ||  Cars[p5] || Cars[p6] ||  Cars[p7] ||Cars[p8] ||  Cars[p9] ||  Cars[p10] || Cars[p11] ||  Cars[p12] ||  Cars[p13] ||  Cars[p14] ||  Cars[p15] ||  Cars[p16] ||  Cars[p17] ||  Cars[p18] ||  Cars[p19] ||  Cars[p20] ||  Cars[p21] ||  Cars[p22]))
[/QUOTE]


Re: Shorten help - basse - 30.09.2012

dident work


Re : Re: Shorten help - yusei - 30.09.2012

Quote:
Originally Posted by basse
Посмотреть сообщение
dident work
you mean add more car in this line

small example :

Код:
if(CarCheck == (Cars[p1] || Cars[p2] ||Cars[p3] ||  Cars[p22]   /// big jump xD ===> 3 to 22
||  Cars[p23] ||  Cars[p24]  ||  Cars[p25] )


edit :

Quote:

please shorten this for me

for you mdr

pawn Код:
if(CarCheck == Cars[p1] || CarCheck == Cars[p2] || CarCheck == Cars[p3] || CarCheck == Cars[p4] || CarCheck == Cars[p5] || CarCheck == Cars[p6] || CarCheck == Cars[p7] || CarCheck == Cars[p8] || CarCheck == Cars[p9] || CarCheck == Cars[p10] || CarCheck == Cars[p11] || CarCheck == Cars[p12] || CarCheck == Cars[p13] || CarCheck == Cars[p14] || CarCheck == Cars[p15] || CarCheck == Cars[p16] || CarCheck == Cars[p17] || CarCheck == Cars[p18]
|| CarCheck == Cars[p19] || CarCheck == Cars[p20] || CarCheck == Cars[p21] || CarCheck == Cars[p22])



Re: Shorten help - basse - 30.09.2012

Thank you!