Delete a Certain Row Using Row ID
#7

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.

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;
}
Reply


Messages In This Thread
Delete a Certain Row Using Row ID - by Ox1gEN - 01.01.2015, 13:21
Re : Delete a Certain Row Using Row ID - by MCZOFT - 01.01.2015, 13:35
Re: Delete a Certain Row Using Row ID - by Vince - 01.01.2015, 13:37
Re: Delete a Certain Row Using Row ID - by Ox1gEN - 01.01.2015, 14:23
Re: Delete a Certain Row Using Row ID - by rickisme - 01.01.2015, 14:48
Re: Delete a Certain Row Using Row ID - by Ox1gEN - 01.01.2015, 15:11
Re: Delete a Certain Row Using Row ID - by Ox1gEN - 01.01.2015, 15:58
Re: Delete a Certain Row Using Row ID - by rickisme - 01.01.2015, 16:07
Re: Delete a Certain Row Using Row ID - by Ox1gEN - 01.01.2015, 17:22
Re: Delete a Certain Row Using Row ID - by rickisme - 02.01.2015, 03:18

Forum Jump:


Users browsing this thread: 1 Guest(s)