Vehicle Menu
#1

~Fixed~
Reply
#2

I think this is what you need.

https://sampwiki.blast.hk/wiki/TextDrawSetPreviewModel
Reply
#3

Is there any tutorial or posted a filter script about it
Reply
#4

Maybe look at this Include: https://sampforum.blast.hk/showthread.php?tid=407045

Greekz
Reply
#5

Why not try this include: https://sampforum.blast.hk/showthread.php?tid=570213

Just in case you want labels with the models, try the dialogs2.inc and see the example(description label version); meant for vehicle spawning.
Reply
#6

Still I don't understand
Reply
#7

Just a simple example using my dialogs include.

First make an array with all the vehicles you want to display in your list. For example:
pawn Код:
new vehicles_array[] =
{
    400,401,402,403,404,405,406
};
Now for showing the list you have prepared, lets use a simple function ShowPlayerDialog.
pawn Код:
ShowPlayerDialog(playerid, 1, DIALOG_STYLE_PREVMODEL, "Vehicles list",  vehicles_array, "Spawn", "Cancel");
You may note that, we use a new dialog style DIALOG_STYLE_PREVMODEL which is only possible with the include and in info[] params, we put our declared array, vehicles_array.

Using this code, the player will be able to see a dialog with the specified vehicles with their model displayed.

Now for handling the response of dialog. You have to use OnDialogResponse.
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == 1)//the dialogid
    {
        if(response)//if player pressed 'SPAWN'
        {
            new Float:pos[4];
            GetPlayerPos(playerid, pos[0], pos[1], pos[2]);
            GetPlayerFacingAngle(playerid, pos[3]);

            new vehicleid = CreateVehicle(strval(inputtext), pos[0], pos[1], pos[2], pos[3], random(255), random(255), -1);

            SetVehicleVirtualWorld(vehicleid, GetPlayerVirtualWorld(playerid));
            LinkVehicleToInterior(vehicleid, GetPlayerInterior(playerid));

            PutPlayerInVehicle(playerid, vehicleid, 0);
        }
    }
    return 1;
}
No whenever the player presses 'Spawn' or Button1(response = 1), the dialog will hide just as normal dialogs do and as we handle the response, a vehicle will be created with the model selected and the player will be put as driver.
Reply
#8

Is there any filterscript released on samp forum
Reply
#9

The guy above just explained exactly what you have to do. If you want someone else to make your script for you then you're posting in the wrong section.
Reply
#10

Okay thanks I will do it
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)