Not showing dialog. - 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: Not showing dialog. (
/showthread.php?tid=424085)
Not showing dialog. -
Kestro - 20.03.2013
So I'm making a /vstorage CMD for a server i'm helping with, and when I try to make it show the dialog, it isn't showing it. Here's the code.
Код:
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;
}
Please help, thanks.
Re: Not showing dialog. -
Misiur - 20.03.2013
pawn Код:
CMD:vstorage(playerid, params[])
{
new vstring[1024];
for(new i, iModelID; i != MAX_PLAYERVEHICLES; ++i) {
if((iModelID = PlayerVehicleInfo[playerid][i][pvModelId] - 400) >= 0) {
strcat(vstring, VehicleName[iModelID]);
if(PlayerVehicleInfo[playerid][i][pvImpounded]) strcat(vstring, " (impounded)\n");
else if(PlayerVehicleInfo[playerid][i][pvDisabled]) strcat(vstring, " (disabled)\n");
else if(!PlayerVehicleInfo[playerid][i][pvSpawned]) strcat(vstring, " (stored)\n");
else strcat(vstring, " (spawned)\n");
}
else strcat(vstring, "\nEmpty");
}
ShowPlayerDialog(playerid, VSTORAGE, DIALOG_STYLE_LIST, "Vehicle storage", vstring, "(De)spawn", "Cancel");
return 1;
}
I've little changed your code. The reasony why the dialog isn't called however isn't visible. Where do you define VSTORAGE? If VSTORAGE is alright, no idea