Personal Cars selection is bugged
#1

Hey guys i have a personal cars system and i have a simple problem but idk how to solve it ... i tryed 100 types of things and nothing works .

When i use /v i see my cars evrything is fine but the problem is when i select one is giving me another car from my inventori or [] if i don't have it [] should be nameless that don't exist.

Код HTML:
CMD:v(playerid, params[])
{
    new gQuery[85], aim[190];
	
	mysql_format(handle, gQuery, sizeof(gQuery), "SELECT * FROM `personalcars` WHERE `Owner` = '%s'", GetName(playerid));
	new Cache: result12 = mysql_query(handle, gQuery);
	
	new gString[55], query[6], query2[6], coordsstring[60] = "ID\tModel\tStatus\tDespawn Time\n";
	for(new i, j = cache_num_rows(); i != j; ++i)
	{
		cache_get_value_name_int(i, "ID", CarInfo[playerid][pcID]); format(query, 4, CarInfo[playerid][pcID]);
		format(Selected[i][scarid], 4, query);
		cache_get_value_name_int(i, "CarID", CarInfo[playerid][pcCarID]); format(query2, 4, CarInfo[playerid][pcCarID]);
		cache_get_value_name_int(i, "Model", CarInfo[playerid][pcCarModel]);
		cache_get_value_name_int(i, "Status", CarInfo[playerid][pcStatus]);

		if(CarInfo[vDBID[query2[i]]][pcStatus] == 0)
		{
			format(gString, sizeof(gString), "%d\t%s\tDespawned\tNo Time\n", i+1, VehicleNames[CarInfo[playerid][pcCarModel] - 400]);
			strcat(aim, gString);	
		}
		else
		{
	        format(gString, sizeof(gString), "%d\t%s\tSpawned\t%d min\n", i+1, VehicleNames[CarInfo[playerid][pcCarModel] - 400], TimerToDespawnCar[CarInfo[query2[i+1]][pcCarID]]);
	        strcat(aim, gString);   
		}
	}
	cache_delete(result12);
	strins(aim, coordsstring, 0);
	ShowPlayerDialog(playerid, DIALOG_OWNEDCARS, DIALOG_STYLE_TABLIST_HEADERS, "Your Garage", aim, "Choose", "Leave");
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)