PDA

View Full Version : help me this dialog sell car


cuchipkg
24/02/2014, 01:09 PM
sorry my english bad, this my dialog sell car
if(strcmp(cmd, "/banxe", true) == 0)
{
new vehicle1;
vehicle1 = GetVehicleModel(PlayerInfo[playerid][CarLinkID]);
new vehicle2;
vehicle2 = GetVehicleModel(PlayerInfo[playerid][Car2LinkID]);
new vehicle3;
vehicle3 = GetVehicleModel(PlayerInfo[playerid][Car3LinkID]);
new vehicle4;
vehicle4 = GetVehicleModel(PlayerInfo[playerid][Car4LinkID]);
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][CarLinkID] == 0 && PlayerInfo[playerid][Car2LinkID] == 0 && PlayerInfo[playerid][Car3LinkID] == 0 && PlayerInfo[playerid][Car4LinkID] == 0)
{
SendClientMessage(playerid, COLOR_GREY, "Ban khong so huu chiec xe nao!");
return 1;
}
else
{
if(PlayerInfo[playerid][CarLinkID] > 0)
{
format(string, sizeof(string), "Vehicle\t(1): %s\n", VehicleNames[vehicle1-400]);
ShowPlayerDialog(playerid, 8171, DIALOG_STYLE_LIST, "Sell Vehicle", string, "Sell", "Cancel");
}
if(PlayerInfo[playerid][Car2LinkID] > 0)
{
format(string, sizeof(string), "Vehicle\t(2): %s\n", VehicleNames[vehicle2-400]);
ShowPlayerDialog(playerid, 8172, DIALOG_STYLE_LIST, "Sell Vehicle", string, "Sell", "Cancel");
}
if(PlayerInfo[playerid][Car3LinkID] > 0)
{
format(string, sizeof(string), "Vehicle\t(3): %s\n", VehicleNames[vehicle3-400]);
ShowPlayerDialog(playerid, 8173, DIALOG_STYLE_LIST, "Sell Vehicle", string, "Sell", "Cancel");
}
if(PlayerInfo[playerid][Car4LinkID] > 0)
{
format(string, sizeof(string), "Vehicle\t(4): %s\n", VehicleNames[vehicle4-400]);
ShowPlayerDialog(playerid, 8178, DIALOG_STYLE_LIST, "Sell Vehicle", string, "Sell", "Cancel");
}
if(PlayerInfo[playerid][CarLinkID] > 0 && PlayerInfo[playerid][Car2LinkID] > 0 && PlayerInfo[playerid][Car4LinkID] > 0)
{
format(string, sizeof(string), "Vehicle\t(1): %s\nVehicle\t(2): %s\nVehicle\t(4): %s", VehicleNames[vehicle1-400], VehicleNames[vehicle2-400], VehicleNames[vehicle4-400]);
ShowPlayerDialog(playerid, 8174, DIALOG_STYLE_LIST, "Sell Vehicle", string, "Sell", "Cancel");
}
if(PlayerInfo[playerid][CarLinkID] > 0 && PlayerInfo[playerid][Car3LinkID] > 0 && PlayerInfo[playerid][Car4LinkID] > 0)
{
format(string, sizeof(string), "Vehicle\t(1): %s\nVehicle\t(3): %s\nVehicle\t(4): %s", VehicleNames[vehicle1-400], VehicleNames[vehicle3-400], VehicleNames[vehicle4-400]);
ShowPlayerDialog(playerid, 8175, DIALOG_STYLE_LIST, "Sell Vehicle", string, "Sell", "Cancel");
}
if(PlayerInfo[playerid][Car2LinkID] > 0 && PlayerInfo[playerid][Car3LinkID] > 0 && PlayerInfo[playerid][Car4LinkID] > 0)
{
format(string, sizeof(string), "Vehicle\t(2): %s\nVehicle\t(3): %s\nVehicle\t(4): %s", VehicleNames[vehicle2-400], VehicleNames[vehicle3-400], VehicleNames[vehicle4-400]);
ShowPlayerDialog(playerid, 8176, DIALOG_STYLE_LIST, "Sell Vehicle", string, "Sell", "Cancel");
}
if(PlayerInfo[playerid][CarLinkID] > 0 && PlayerInfo[playerid][Car2LinkID] > 0 && PlayerInfo[playerid][Car3LinkID] > 0)
{
format(string, sizeof(string), "Vehicle\t(1): %s\nVehicle\t(2): %s\nVehicle\t(3): %s", VehicleNames[vehicle1-400], VehicleNames[vehicle2-400], VehicleNames[vehicle3-400]);
ShowPlayerDialog(playerid, 8179, DIALOG_STYLE_LIST, "Sell Vehicle", string, "Sell", "Cancel");
}
if(PlayerInfo[playerid][CarLinkID] > 0 && PlayerInfo[playerid][Car2LinkID] > 0 && PlayerInfo[playerid][Car3LinkID] > 0 && PlayerInfo[playerid][Car4LinkID] > 0)
{
format(string, sizeof(string), "Vehicle\t(1): %s\nVehicle\t(2): %s\nVehicle\t(3): %s\nVehicle\t(4): %s\n", VehicleNames[vehicle1-400], VehicleNames[vehicle2-400], VehicleNames[vehicle3-400], VehicleNames[vehicle4-400]);
ShowPlayerDialog(playerid, 8177, DIALOG_STYLE_LIST, "Sell Vehicle", string, "Sell", "Cancel");
}
}
}
return 1;
}
4 slot car no error
http://i5.upanh.com/2014/0224/14//58806977.1.bmp?rand=0.4921712020877749
add this error i sell car slot 4 and "server:unknow commads"
http://i2.upanh.com/2014/0224/14//58806974.2.bmp?rand=0.5961304705124348
noo see slot 1,3

cuchipkg
25/02/2014, 03:13 AM
help me please

Aerotactics
25/02/2014, 04:21 AM
This might be redundant, but why use "format" for dialogs?

cuchipkg
26/02/2014, 10:54 AM
dialog and format error sell car

Lloyde
26/02/2014, 01:54 PM
You have a Dialog error and there's a lot of error of this script


_________________
Give me Reputation

cuchipkg
27/02/2014, 03:14 AM
you can help me fix this dialog ?