26.03.2012, 22:12
Does that extra bracket have anything to do with it?
EDIT: Oh my bad...Was just bad indentation
EDIT2: Does 1 ID show up? If so...Try this out
EDIT3: wait a minute...What are you using a loop for?
We already know their vehicle ID's...
EDIT: Oh my bad...Was just bad indentation
EDIT2: Does 1 ID show up? If so...Try this out
pawn Код:
CMD:mycars(playerid, params[])
{
new string[64];
if(LoggedIn[playerid] == 0) return SendClientMessage(playerid, COLOUR_GREY, "You must be logged in to use this command.");
PlayerSQLID[playerid] = MySQL_GetValue(PlayerSQLID[playerid], "id", "accounts");
VehicleSlot1[playerid] = MySQL_GetValue(PlayerSQLID[playerid], "VehSlot1", "accounts");
VehicleSlot2[playerid] = MySQL_GetValue(PlayerSQLID[playerid], "VehSlot2", "accounts");
VehicleSlot3[playerid] = MySQL_GetValue(PlayerSQLID[playerid], "VehSlot3", "accounts");
if(VehicleSlot1[playerid] == 0 && VehicleSlot2[playerid] == 0 && VehicleSlot3[playerid] == 0) return SendClientMessage(playerid, COLOUR_GREY, "You do not have any vehicles.");
for(new v = 1; v < MAX_VEHICLES; v++)
{
printf("Vehicle ID: %d", VehicleSQLID[v]);
VehicleSQLID[v] = MySQL_GetValue(VehicleSQLID[v], "id", "vehicles");
format(string, sizeof(string), "Your Vehicles: ");
new second[6];
if(VehicleSlot1[playerid] == VehicleSQLID[v])
{
format(second, sizeof(second), "(%d) ", v);
strcat(string, second);
}
if(VehicleSlot2[playerid] == VehicleSQLID[v])
{
format(second, sizeof(second), "(%d) ", v);
strcat(string, second);
}
if(VehicleSlot3[playerid] == VehicleSQLID[v])
{
format(second, sizeof(second), "(%d)", v);
strcat(string, second);
}
SendClientMessage(playerid, COLOUR_GREEN, string);
}
return 1;
}
pawn Код:
CMD:mycars(playerid, params[])
{
if(LoggedIn[playerid] == 0) return SendClientMessage(playerid, COLOUR_GREY, "You must be logged in to use this command.");
VehicleSlot1[playerid] = MySQL_GetValue(PlayerSQLID[playerid], "VehSlot1", "accounts");
VehicleSlot2[playerid] = MySQL_GetValue(PlayerSQLID[playerid], "VehSlot2", "accounts");
VehicleSlot3[playerid] = MySQL_GetValue(PlayerSQLID[playerid], "VehSlot3", "accounts");
if(VehicleSlot1[playerid] == 0 && VehicleSlot2[playerid] == 0 && VehicleSlot3[playerid] == 0) return SendClientMessage(playerid, COLOUR_GREY, "You do not have any vehicles.");
new string[64], second[6];
format(string, sizeof(string), "Your vehicles: ");
if(VehicleSlot1[playerid] != 0)
{
format(second, sizeof(second), "(%d) ", VehicleSlot1[playerid]);
strcat(string, second);
}
if(VehicleSlot2[playerid] != 0)
{
format(second, sizeof(second), "(%d) ", VehicleSlot2[playerid]);
strcat(string, second);
}
if(VehicleSlot3[playerid] != 0)
{
format(second, sizeof(second), "(%d)", VehicleSlot3[playerid]);
strcat(string, second);
}
SendClientMessage(playerid, string);
return 1;
}

