01.01.2015, 17:22
Mhm-.. I see.
So I need to use instead of the ID in this:
with this?
And another thing, what do I do with the pickup, I did as you said, yet it doesn't work.
I probably frustrate you because I do not understand, so sorry about that
So I need to use instead of the ID in this:
pawn Код:
mysql_format(dbHandle, query, sizeof(query), "DELETE FROM `dealerships` WHERE `DsID` = %d", id);
pawn Код:
mysql_format(dbHandle, query, sizeof(query), "DELETE FROM `dealerships` WHERE `DsID` = %d", DS[id][DsID]);
I probably frustrate you because I do not understand, so sorry about that
pawn Код:
forward destroyDEALERSHIP(playerid, id);
public destroyDEALERSHIP(playerid, id) {
if(cache_affected_rows(dbHandle) > 0) {
DestroyPickup(DS[id][DsIcon]); //This part, it doesn't delete the pickup.
printf("Successfully deleted dealership id %d --", DS[id][DsID]);
format(ZString, sizeof(ZString), "[ ! ] Successfully DELETED DealerShip ID:%d. (SQL-ROW-ID:%d)", id, DS[id][DsID]); //Thanks to 'rickisme' for helping me with this one.
SendClientMessage(playerid, COLOR_SUCCESS, ZString);
mysql_tquery(dbHandle, "SELECT * FROM `dealerships`", "loadDEALERSHIPS");
} else return SendClientMessage(playerid, COLOR_ERROR, "[ ! ] Invalid DEALERSHIP ID.");
return 1;
}
forward loadDEALERSHIPS(); //Here's where I fetch all the ds info
public loadDEALERSHIPS() {
for(new i = 0 ; i < cache_num_rows(dbHandle) ; i++) { // Dealership information - Fetched.
DS[i][DsID] = cache_get_field_content_int(i, "DsID", dbHandle);
DS[i][DsLocX] = cache_get_field_content_float(i, "DsLocX", dbHandle);
DS[i][DsLocY] = cache_get_field_content_float(i, "DsLocY", dbHandle);
DS[i][DsLocZ] = cache_get_field_content_float(i, "DsLocZ", dbHandle);
DS[i][DsIcon] = cache_get_field_content_int(i, "DsIcon", dbHandle);
DS[i][DsIcon] = CreatePickup(1239, 23, DS[i][DsLocX], DS[i][DsLocY], DS[i][DsLocZ], -1); //And here is where I set the icon
}
printf("[ OXIGEN's VEHICLES ] [ ! ] Loaded %d DEALERSHIPS", cache_num_rows(dbHandle));
return 1;
}