01.01.2015, 15:58
Here's my code, turns out this new code that you gave me works, it actually deletes it from the database.
It also won't destroy the pickup.
But when I attempt to buy a dealership it still says that there's a dealership there.
Instead of saying there isn't.
But it's deleted from the db.
Here's my whole code, let me know what's wrong here-.. You'll probably get a late response if you respond to me because i g2g.
It also won't destroy the pickup.
But when I attempt to buy a dealership it still says that there's a dealership there.
Instead of saying there isn't.
But it's deleted from the db.
Here's my whole code, let me know what's wrong here-.. You'll probably get a late response if you respond to me because i g2g.
pawn Код:
YCMD:destroydealerships(playerid, params[], help) {
new id;
if(!IsPlayerAdmin(playerid)) return 0;
else {
if(sscanf(params, "d", id)) return SendClientMessage(playerid, COLOR_NOTE, "[ ! ] SYNTAX: /DestroyDealership [DS-ID]");
new query[128];
mysql_format(dbHandle, query, sizeof(query), "DELETE FROM `dealerships` WHERE `DsID` = %d", id);
mysql_tquery(dbHandle, query, "destroyDEALERSHIP", "dd", playerid, id);
}
return 1;
}
forward destroyDEALERSHIP(playerid, id);
public destroyDEALERSHIP(playerid, id) {
if(cache_affected_rows(dbHandle) > 0) {
DestroyPickup(DS[id][DsIcon]);
printf("Successfully deleted dealership id %d --", id);
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;
}

