Call all arrays in one
#4

PHP код:
new veh[2] =  
        {    
400401 }; 
There is too ways, depending on the size of the arrays you have to decide, but if the arrays size often changes, i recommend way 1

PHP код:
for(new isizeof(veh); i++) 

    if(
GetVehicleModel(vmodel) == veh[i])
    {
        new 
modelText[30];
        
format(modelText30"The Vehicle model is: %d"veh[i]);
        
printf("%s"modelText);
        return 
1;
    }

or

PHP код:
if(GetVehicleModel(vmodel) == veh[0] || GetVehicleModel(vmodel) == veh[1])
{
    return 
1;

and also

Quote:
PHP код:
if(GetVehicleModel(vmodel) == veh[2])  //the veh[2] will call only the number 401 
this would give you an out of bounds error, because max index is "1".
Reply


Messages In This Thread
Call all arrays in one - by coool - 11.12.2016, 06:29
Re: Call all arrays in one - by AjaxM - 11.12.2016, 06:38
Re: Call all arrays in one - by coool - 11.12.2016, 06:46
Re: Call all arrays in one - by BiosMarcel - 11.12.2016, 11:10
Re: Call all arrays in one - by coool - 11.12.2016, 11:24
Re: Call all arrays in one - by BiosMarcel - 11.12.2016, 11:28
Re: Call all arrays in one - by Logic_ - 11.12.2016, 11:34
Re: Call all arrays in one - by BiosMarcel - 11.12.2016, 11:34
Re: Call all arrays in one - by Logic_ - 11.12.2016, 11:36

Forum Jump:


Users browsing this thread: 1 Guest(s)