26.03.2012, 22:09
I cannot figure this one out, at all, would someone help me with this. It just doesn't work, at all.
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");
if(VehicleSlot1[playerid] == VehicleSQLID[v] || VehicleSlot2[playerid] == VehicleSQLID[v] || VehicleSlot3[playerid] == VehicleSQLID[v])
{
SendClientMessage(playerid, COLOUR_WHITE, "Your Vehicles:");
format(string, sizeof(string), "(%d)",v);
SendClientMessage(playerid, COLOUR_GREEN, string);
}
}
return 1;
}