how do you do this?
#1

I made a command to show you all the vehicles you own.

pawn Код:
if(strcmp(cmd, "/veh", true) == 0)
    {
        if(PlayerInfo[playerid][pCarKey1] == 999 && PlayerInfo[playerid][pCarKey1] == 999)
        {
            SendClientMessage(playerid, COLOR_WHITE,"You can only own 2 vehicles");
            return 1;
        }
        new stringV[256];
        new option1[128];
        new option2[128];
        new CarFile[35];
        new CarFile2[35];
        format(CarFile,sizeof(CarFile),"Auta/%d.ini",PlayerInfo[playerid][pCarKey1]);
        new CarID = dini_Int(CarFile,"ModelID");
        format(CarFile2,sizeof(CarFile2),"Auta/%d.ini",PlayerInfo[playerid][pCarKey2]);
        new CarID2 = dini_Int(CarFile2,"ModelID");
        format(option1,sizeof(option1),"%s [UID: %d]",GetVehicleNameFromID(CarID),PlayerInfo[playerid][pCarKey1]);
        format(option2,sizeof(option2),"%s [UID: %d]",GetVehicleNameFromID(CarID2),PlayerInfo[playerid][pCarKey2]);
        format(stringV,sizeof(stringV),"%s\n%s",option1,option2);
        ShowPlayerDialog(playerid, VCMD, DIALOG_STYLE_LIST, "Your Vehicles:", stringV, "Spawn", "More");
        return 1;
    }
pawn Код:
if(dialogid == VCMD)
    {
        if(response)
        {
            //this is what im struggling with.
            {
Now, how can I create different action when you pick a vehicle, as IDK if that vehicle will be there? Should I globolize option1 and 2. And then use something like if(opion1) { }, or something?

Thx anyway.
Reply


Messages In This Thread
how do you do this? - by HondaCBR - 01.01.2012, 22:52
Re: how do you do this? - by Jefff - 01.01.2012, 23:03
Re: how do you do this? - by HondaCBR - 01.01.2012, 23:14
Re: how do you do this? - by HondaCBR - 01.01.2012, 23:30
Re: how do you do this? - by HondaCBR - 02.01.2012, 08:45

Forum Jump:


Users browsing this thread: 1 Guest(s)