I've recently added a car dealership to my script, however, commands keep bugging out. Sometimes the commands will work and sometimes they won't. This is one of my car commands, /findcar and it worked earlier, but now it doesn't work. It says "unknown command"
Code:
if(strcmp(cmd, "/findcar", true) == 0)
{
new vehicle1;
vehicle1 = GetVehicleModel(PlayerInfo[playerid][CarLinkID]);
new vehicle2;
vehicle2 = GetVehicleModel(PlayerInfo[playerid][Car2LinkID]);
new vehicle3;
vehicle3 = GetVehicleModel(PlayerInfo[playerid][Car3LinkID]);
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][CarLinkID] == 0 && PlayerInfo[playerid][Car2LinkID] == 0 && PlayerInfo[playerid][Car3LinkID] == 0)
{
SendClientMessage(playerid, COLOR_GREY, "You don't own a vehicle.");
return 1;
}
else
{
if(PlayerInfo[playerid][CarLinkID] > 0)
{
format(string, sizeof(string), "Vehicle\t(1): %s\n", VehicleNames[vehicle1-400]);
ShowPlayerDialog(playerid, 11111, DIALOG_STYLE_LIST, "Vehicle Location", string, "Find", "Cancel");
}
if(PlayerInfo[playerid][Car2LinkID] > 0)
{
format(string, sizeof(string), "Vehicle\t(2): %s\n", VehicleNames[vehicle2-400]);
ShowPlayerDialog(playerid, 22222, DIALOG_STYLE_LIST, "Vehicle Location", string, "Find", "Cancel");
}
if(PlayerInfo[playerid][Car3LinkID] > 0)
{
format(string, sizeof(string), "Vehicle\t(3): %s\n", VehicleNames[vehicle3-400]);
ShowPlayerDialog(playerid, 33333, DIALOG_STYLE_LIST, "Vehicle Location", string, "Find", "Cancel");
}
if(PlayerInfo[playerid][CarLinkID] > 0 && PlayerInfo[playerid][Car2LinkID] > 0)
{
format(string, sizeof(string), "Vehicle\t(1): %s\nVehicle\t(2): %s\n", VehicleNames[vehicle1-400], VehicleNames[vehicle2-400]);
ShowPlayerDialog(playerid, 11222, DIALOG_STYLE_LIST, "Vehicle Location", string, "Find", "Cancel");
}
if(PlayerInfo[playerid][CarLinkID] > 0 && PlayerInfo[playerid][Car3LinkID] > 0)
{
format(string, sizeof(string), "Vehicle\t(1): %s\nVehicle\t(3): %s\n", VehicleNames[vehicle1-400], VehicleNames[vehicle3-400]);
ShowPlayerDialog(playerid, 11333, DIALOG_STYLE_LIST, "Vehicle Location", string, "Find", "Cancel");
}
if(PlayerInfo[playerid][Car2LinkID] > 0 && PlayerInfo[playerid][Car3LinkID] > 0)
{
format(string, sizeof(string), "Vehicle\t(2): %s\nVehicle\t(3): %s\n", VehicleNames[vehicle2-400], VehicleNames[vehicle3-400]);
ShowPlayerDialog(playerid, 22333, DIALOG_STYLE_LIST, "Vehicle Location", string, "Find", "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\n", VehicleNames[vehicle1-400], VehicleNames[vehicle2-400], VehicleNames[vehicle3-400]);
ShowPlayerDialog(playerid, 12233, DIALOG_STYLE_LIST, "Vehicle Location", string, "Find", "Cancel");
}
}
}
return 1;
}