SA-MP Forums Archive
Dialog keeps changing back - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Dialog keeps changing back (/showthread.php?tid=491453)



Dialog keeps changing back - Jimmy0wns - 30.01.2014

I'm having this problem lately, that when i try to buy a vehicle at the dealership, it gives me a confirmation screen but it disappears after 1/2 second(s).

This is the dialog:
pawn Код:
if(dialogid == dealership1)
    {
        if(response)
        {
            new VehName[80], priceshit[20], string[250],price[20];
            sscanf(inputtext, "p<(>s[80]s[20]", VehName,priceshit);
            print(VehName);
            DealerShipModel[playerid] = ReturnVehicleID(VehName);
            for(new i; i < sizeof(DealerShipVehicles); i++)
            {
                if(DealerShipVehicles[i][VModel] == DealerShipModel[playerid])
                {
                    format(price,sizeof(price),"$%d",DealerShipVehicles[i][VPrice]);
                }
            }
            format(string,sizeof(string),"{FF0000}Are you sure you want to buy the following?\n\n{FFFFFF}Vehicle: \t\t{1B8AE4}%s\n{FFFFFF}Price: \t\t\t{1B8AE4}%s",VehicleFriendlyNames[DealerShipModel[playerid]-400],price);
            ShowPlayerDialog(playerid, dealership2, DIALOG_STYLE_MSGBOX, "Are you sure?", string, "Buy","Cancel");
        }
    }
Same to where i can select the vehicle, when i scroll down, after 1/2 second(s) it puts me on top of the list again.
It's a pretty annoying bug where i can't find the problem about it myself, i hope one of you can.

This is the stock i use to load my dealerships, it's based on pickups
pawn Код:
stock LoadDealerships()
{
    for(new i; i < sizeof(DealerShips); i++)
    {
        new string[128];
        DealerShips[i][PickupID] = CreateDynamicPickup(1239,23,DealerShips[i][LocX],DealerShips[i][LocY],DealerShips[i][LocZ],0);
        format(string, sizeof(string), "{FFFF00}%s", DealerShips[i][DealershipName]);
        DealerShips[i][labeltext] = Create3DTextLabel(string,0xFFFFFFFF,DealerShips[i][LocX],DealerShips[i][LocY],DealerShips[i][LocZ],15.0,0,0);
    }
    print("Dealerships has been loaded");

    return 1;
}



Re: Dialog keeps changing back - AaronFarley - 30.01.2014

Use: CreateDynamicPickup(1239,2,DealerShips[i][LocX],DealerShips[i][LocY],DealerShips[i][LocZ],0);

Your pickup id was 23. That aint a real id. Use id 2. The pickup will respawn later on.
May i also suggest dynamic checkpoints. As they would be easier imo. Incognito's would be the best.


Re: Dialog keeps changing back -SOLVED- - Jimmy0wns - 30.01.2014

Quote:
Originally Posted by AaronFarley
Посмотреть сообщение
Use: CreateDynamicPickup(1239,2,DealerShips[i][LocX],DealerShips[i][LocY],DealerShips[i][LocZ],0);

Your pickup id was 23. That aint a real id. Use id 2. The pickup will respawn later on.
May i also suggest dynamic checkpoints. As they would be easier imo. Incognito's would be the best.
Thanks, eh.
-solved-.


Re: Dialog keeps changing back -SOLVED- - AaronFarley - 31.01.2014

Quote:
Originally Posted by Jimmy0wns
Посмотреть сообщение
Thanks, eh.
-solved-.
No problem