06.10.2011, 19:20
Hi. I don't know what's wrong with this code.. It just wont delete the row from the database.. I tried to debug the code as much as I can but I can't seem to find the problem. There are no errors or anything like that.. Anyone might have a clue on what's wrong?
pawn Код:
CMD:fdelete(playerid, params[])
{
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, 0xE60000FF, "You are not a RCON-Admin!");
if(!isnull(params)) return SendClientMessage(playerid, 0xE60000FF, "USAGE: /Fdelete [{00FF33}ID{E60000}]");
if(!IsNumeric(params)) return SendClientMessage(playerid, 0xE60000FF, "ERROR: You did not enter a number!");
if(!IsVaildDBId(strval(params))) return SendClientMessage(playerid, 0xE60000FF, "ERROR: That ID was not found in the database");
new query[128];
format(query, sizeof(query), "DELETE FROM `System` WHERE `ID` = '%d'",strval(params));
db_query(GPDB,query);
return 1;
}