Wrong loop result.
#2

First of all change your VehiclePrices declaration to this :
Quote:

new VehiclePrices[47][2]

Then use this code:
PHP Code:
stock ShowVehicleDialog(playerid)
{
    new 
model GetVehicleModel(GetPlayerVehicleID(playerid)), found = -1;
    for ( new 
0sizeof(VehiclePrices); i++ )
    {
        if(
model == VehiclePrices[i][0])
        {
            
found i;
            break;
        }
    }    
    new 
str[100];
    if(
found == -1)str "Model not found";
    
//note the difference in format parameters in next line
    
else format(strsizeof(str), "%s %d "COL_DGREEN"$%d"VehicleNames[model-400], modelFormatNumber(VehiclePrices[found][1]));
    
Dialog_Show(playeridBUYVEHICLEDIALOG_STYLE_LISTstr,"Test""Seз""İptal");    
    return 
1;

Reply


Messages In This Thread
Wrong loop result. - by Rongvaldyr - 19.01.2017, 00:56
Re: Wrong loop result. - by BroZeus - 19.01.2017, 04:20
Re: Wrong loop result. - by Rongvaldyr - 19.01.2017, 04:30
Re: Wrong loop result. - by Rongvaldyr - 19.01.2017, 04:35
Re: Wrong loop result. - by Rongvaldyr - 19.01.2017, 04:39

Forum Jump:


Users browsing this thread: 1 Guest(s)