14.05.2017, 19:32
Hey all,
So I was working on a /vehicles command which shows you all the vehicles you own, but when I had bought the vehicle and used the command it said that my character doesn't own any vehicles, yet I'm sure I did everything right, someone mind showing me what I did wrong and why I did it wrong?
Code:
So I was working on a /vehicles command which shows you all the vehicles you own, but when I had bought the vehicle and used the command it said that my character doesn't own any vehicles, yet I'm sure I did everything right, someone mind showing me what I did wrong and why I did it wrong?
Code:
pawn Код:
CMD:vehicles(playerid, params[])
{
new bool:found = false, list[512];
list = "ID\tVehicle\tNumber Plate\n";
for (new i = 0; i < MAX_VEHICLES; i++)
{
if(PlayerVehicle[v][pvStatus] == 1)
{
if (!strcmp(PlayerVehicle[i][pvOwner], owner, true)) {
found = true;
format(list, sizeof(list), "%s%d\t%s\t%s\n", list, v, GetVehicleName(v), PlayerVehicle[v][pvPlate]);
}
}
}
if(found == true) return ShowPlayerDialog(playerid, DIALOG_MYVEHICLES, DIALOG_STYLE_TABLIST_HEADERS, "Vehicles", list, "Select", "Close");
else return ShowPlayerDialog(playerid, 9999, DIALOG_STYLE_MSGBOX, "Vehicles", "{FF0000}No vehicles found!", "Close", "");
}