#define VSTORAGE 19104
CMD:vstorage(playerid, params[])
{
new vstring[1024];
for(new i, iModelID; i < MAX_PLAYERVEHICLES; i++) {
if((iModelID = PlayerVehicleInfo[playerid][i][pvModelId] - 400) >= 0) {
if(PlayerVehicleInfo[playerid][i][pvImpounded]) {
format(vstring, sizeof(vstring), "%s\n%s (impounded)", vstring, VehicleName[iModelID]);
}
else if(PlayerVehicleInfo[playerid][i][pvDisabled]) {
format(vstring, sizeof(vstring), "%s\n%s (disabled)", vstring, VehicleName[iModelID]);
}
else if(!PlayerVehicleInfo[playerid][i][pvSpawned]) {
format(vstring, sizeof(vstring), "%s\n%s (stored)", vstring, VehicleName[iModelID]);
}
else format(vstring, sizeof(vstring), "%s\n%s (spawned)", vstring, VehicleName[iModelID]);
}
else strcat(vstring, "\nEmpty");
}
ShowPlayerDialog(playerid, VSTORAGE, DIALOG_STYLE_LIST, "Vehicle storage", vstring, "(De)spawn", "Cancel");
return 1;
}
|
Add the OnDialogResponse part ? of you choose store or destore where is the response ?!?!?! https://sampwiki.blast.hk/wiki/OnDialogResponse
|
OnDialogResponse
|
Search for this in your script:
pawn Код:
|
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == VSTORAGE 19104)
{
if(response)
{
if(listitem == 0)
{
GivePlayerWeapon(playerid, WEAPON_DEAGLE, 14);
}
if(listitem == 1)
{
GivePlayerWeapon(playerid, WEAPON_AK47, 120);
}
if(listitem == 2)
{
GivePlayerWeapon(playerid, WEAPON_SHOTGSPA, 28);
}
}
return 1;
}
return 0;
}
|
This is an example for what do you want:
pawn Код:
![]() |
CMD:vstorage(playerid, params[])
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == VSTORAGE 19104)
new vstring[1024];
for(new i, iModelID; i < MAX_PLAYERVEHICLES; i++) {
if((iModelID = PlayerVehicleInfo[playerid][i][pvModelId] - 400) >= 0) {
if(PlayerVehicleInfo[playerid][i][pvImpounded]) {
format(vstring, sizeof(vstring), "%s\n%s (impounded)", vstring, VehicleName[iModelID]);
}
else if(PlayerVehicleInfo[playerid][i][pvDisabled]) {
format(vstring, sizeof(vstring), "%s\n%s (disabled)", vstring, VehicleName[iModelID]);
}
else if(!PlayerVehicleInfo[playerid][i][pvSpawned]) {
format(vstring, sizeof(vstring), "%s\n%s (stored)", vstring, VehicleName[iModelID]);
}
else format(vstring, sizeof(vstring), "%s\n%s (spawned)", vstring, VehicleName[iModelID]);
}
else strcat(vstring, "\nEmpty");
}
ShowPlayerDialog(playerid, VSTORAGE, DIALOG_STYLE_LIST, "Vehicle storage", vstring, "(De)spawn", "Cancel");
return 1;
}