28.11.2014, 11:50
Hi guys )
I have problem with that:
I don't know how to check, if the UID of the shop exists in the database. If not the server shows error. Can you help me ?
I have problem with that:
Код:
CMD:delete(playerid, params[]) { if(isnull(params)) { SendClientMessage(playerid, COLOR_RED, "[ERROR] Use: "CWHITE"/delete [ID]"); return 1; } new id = strval(params); format(query, sizeof(query), "SEELCT `UID` FROM `mapa_shop` WHERE `UID` = '%d'",id); mysql_query(query); if(!mysql_num_rows()) { format(dstring,sizeof(dstring),"[ERROR] The database does not have a shop with UID:"CWHITE" %d",id); SendClientMessage(playerid, COLOR_RED, dstring); return 1; } ReloadShop(); format(query, sizeof(query), "DELETE FROM `mapa_shop` WHERE `UID` = '%d'",id); mysql_query(query); return 1; }