Try this one.
pawn Код:
#include <a_samp>
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/trunk", cmdtext, true, 5) == 0)
{
ShowPlayerDialog(playerid, 20320, DIALOG_STYLE_LIST, "Trunk", "Weapons\nCars", "Select", "Exit");
return 1;
}
return 0;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 20320 && response)
{
switch(listitem)
{
case 0:
{
ShowPlayerDialog(playerid, 20321, DIALOG_STYLE_LIST, "Weapons", "M4\nMP5", "Select", "Cancel");
}
case 1:
{
ShowPlayerDialog(playerid, 20322, DIALOG_STYLE_LIST, "Vehicles", "BMX\nFaggio", "Select", "Cancel");
}
}
}
if(dialogid == 20321 && response)
{
switch(listitem)
{
case 0:
{
GivePlayerWeapon(playerid, 31, 9999);
}
case 1:
{
GivePlayerWeapon(playerid, 29, 9999);
}
}
}
if(dialogid == 20322 && response)
{
switch(listitem)
{
case 0:
{
new Float:x, Float:y, Float:z;
new BMX;
GetPlayerPos(playerid, x, y, z);
BMX = CreateVehicle(481, x, y, z, 82.2873, 0, 1, 999999);
PutPlayerInVehicle(playerid, BMX, 0);
}
case 1:
{
new Float:x, Float:y, Float:z;
new Faggio;
GetPlayerPos(playerid, x, y, z);
Faggio = CreateVehicle(462, x, y, z, 82.2873, 0, 1, 999999);
PutPlayerInVehicle(playerid, Faggio, 0);
}
}
}
return 1;
}