Getting every vehicle price with a function or...
#6

Quote:
Originally Posted by Mic_H
Посмотреть сообщение
PHP код:
enum vDealerInfo
{
    
DVehName[25],
    
DVehPrice,
    
DVehModel
}
new 
VehDetails_Sports[xxx][vDealerInfo]=
{
//     Name     Price  ModelID
    
{"Infernus"100000,  411}, //0
    
.. // 1
    
..// 2
    
..// etc
    
};
new 
VehDetails_Bikes[xxx][vDealerInfo]=
{
//     Name     Price  ModelID
    
{"NRG-500",  50000,   511}, //0
    
.. //1
    
.. //2
    
..//etc
};
CMD:buy(playeridparams[])
{
    
//ifPlayerHasn'tReachedMax_OwnedVehicleLimit                        0      1     2....
    
ShowPlayerDialog(playerid0DIALOG_STYLE_LIST"Dealership!!""Sports\nBikes\netc""Select""");
    return 
1;
}
public 
OnDialogResponse(playeriddialogidresponselistiteminputtext[])
{
    if(
dialogid == 0)
    {
        if(!
response// If they clicked 'Cancel' or pressed esc
        
{
            
SendClientMessage(playerid, -1"BitchPlease you too poor.");
        }
        else 
// Pressed ENTER
        
{
            switch(
listitem)
            {
                case 
0:
                {
                    for(new 
0i<sizeof(VehDeatails_Sports); i++)
                    {
                        
format(MSGsizeof(MSG), "%s%s - %i\n"MSG,VehDetails_Sports[i][VehName], VehDetails_Sports[i][VehPrice]);
                    }
                    
ShowPlayerDialog(playerid1DIALOG_STYLE_LIST"Sports"MSG);
                }
                case 
1:
                {
                    for(new 
0i<sizeof(VehDeatails_Bikes); i++)
                    {
                        
format(MSGsizeof(MSG), "%s%s - %i\n"MSG,VehDetails_Bikes[i][VehName], VehDetails_Bikes[i][VehPrice]);
                    }
                    
ShowPlayerDialog(playerid2DIALOG_STYLE_LIST"Bikes"MSG);
                }
            }
        }
        return 
1// We handled dialog, so return 1.
    
}
    else if(
dialogid == 1)//Sports
    
{
        if(!
response)
        {
            
SendClientMessage(playerid, -1"You aint even rich enough to read their names!");
        }
        else
        {
            
//Store the Values and Show him the rest of the infos.
            /*
                For Example:
                PlayerChosenVehicle[playerid]==VehDetails_Sports[listitem][DVehModel];
                ShowPlayerDialog(SeleteColorForVehicle);
                ...
            */
        
}
    }
    else if(
dialogid == 2)//Bikes
    
{
         if(!
response)
        {
            
SendClientMessage(playerid, -1"Can you even hold a stick bro?");
        }
        else
        {
            
//Store the Values and Show him the rest of the infos.
        
}
    }
    return 
0// You MUST return 0 here

Thank you so much.
Reply


Messages In This Thread
Getting every vehicle price with a function or... - by Ox1gEN - 14.12.2014, 18:13
Re: Getting every vehicle price with a function or... - by mirou123 - 14.12.2014, 18:17
Re: Getting every vehicle price with a function or... - by Ox1gEN - 14.12.2014, 18:19
Re: Getting every vehicle price with a function or... - by Mic_H - 14.12.2014, 18:57
Re: Getting every vehicle price with a function or... - by Clad - 14.12.2014, 18:57
Re: Getting every vehicle price with a function or... - by Ox1gEN - 15.12.2014, 11:14

Forum Jump:


Users browsing this thread: 2 Guest(s)