08.10.2015, 12:24
Hi, i Created 20 cars, and I want to check the small id of the vehicle. I know when I start the server the lowest id is
CreatedCarsOn[0] but I destroy the smallest id and I creat Another car, and how can I check The lowest Id from this 20 vehicles. I try this but on't work. is it a simple way to find?
CreatedCarsOn[0] but I destroy the smallest id and I creat Another car, and how can I check The lowest Id from this 20 vehicles. I try this but on't work. is it a simple way to find?
PHP код:
TennIdCreated()
{
new smallid;
if(CreatedCarsOn[0]<CreatedCarsOn[1])
smallid = CreatedCarsOn[1];
if(CreatedCarsOn[1]<smallid)
smallid = CreatedCarsOn[1];
if(CreatedCarsOn[2]<smallid)
smallid = CreatedCarsOn[2];
if(CreatedCarsOn[3]<smallid)
smallid = CreatedCarsOn[3];
if(CreatedCarsOn[4]<smallid)
smallid = CreatedCarsOn[4];
if(CreatedCarsOn[5]<smallid)
smallid = CreatedCarsOn[5];
if(CreatedCarsOn[6]<smallid)
smallid = CreatedCarsOn[6];
if(CreatedCarsOn[7]<smallid)
smallid = CreatedCarsOn[7];
if(CreatedCarsOn[8]<smallid)
smallid = CreatedCarsOn[8];
if(CreatedCarsOn[9]<smallid)
smallid = CreatedCarsOn[9];
if(CreatedCarsOn[10]<smallid)
smallid = CreatedCarsOn[10];
if(CreatedCarsOn[11]<smallid)
smallid = CreatedCarsOn[11];
if(CreatedCarsOn[12]<smallid)
smallid = CreatedCarsOn[12];
if(CreatedCarsOn[13]<smallid)
smallid = CreatedCarsOn[13];
if(CreatedCarsOn[14]<smallid)
smallid = CreatedCarsOn[14];
if(CreatedCarsOn[15]<smallid)
smallid = CreatedCarsOn[15];
if(CreatedCarsOn[16]<smallid)
smallid = CreatedCarsOn[16];
if(CreatedCarsOn[17]<smallid)
smallid = CreatedCarsOn[17];
if(CreatedCarsOn[18]<smallid)
smallid = CreatedCarsOn[18];
if(CreatedCarsOn[19]<smallid)
smallid = CreatedCarsOn[19];
if(CreatedCarsOn[20]<smallid)
smallid = CreatedCarsOn[20];
return smallid;
}