rawn3cr0 1 Posted May 1, 2019 Share Posted May 1, 2019 How i can make a in game command in source like: /delete_item 280 where 280 is item id from offlineshop. I try something last night but dont work.. Link to comment Share on other sites More sharing options...
Active Member hachiwari 138 Posted May 1, 2019 Active Member Share Posted May 1, 2019 .. so show yours work and what's not working Link to comment Share on other sites More sharing options...
rawn3cr0 1 Posted May 1, 2019 Author Share Posted May 1, 2019 Acum 31 minute, hachiwari a spus: .. so show yours work and what's not working Im not now at pc .... Link to comment Share on other sites More sharing options...
rawn3cr0 1 Posted May 1, 2019 Author Share Posted May 1, 2019 ACMD(do_shop_delete) { char arg1[256]; one_argument(argument, arg1, sizeof(arg1)); if (!*arg1) { ch->ChatPacket(CHAT_TYPE_INFO, "Usage:"); ch->ChatPacket(CHAT_TYPE_INFO, "/delete_shop <type> <arg> "); ch->ChatPacket(CHAT_TYPE_INFO, "Types:"); ch->ChatPacket(CHAT_TYPE_INFO, " id - Delete item from shop using ID"); ch->ChatPacket(CHAT_TYPE_INFO, "Example:"); ch->ChatPacket(CHAT_TYPE_INFO, " /delete_shop id 1"); return; } if (!strcmp(arg1, "id")) { SQLMsg * pkMsg(DBManager::instance().DirectQuery("delete from player_shop_items WHERE id='%s'", arg1)); SQLResult * pRes = pkMsg->Get(); if (pRes->uiNumRows>0) { MYSQL_ROW row; while ((row = mysql_fetch_row(pRes->pSQLResult)) != NULL) { DWORD id; str_to_number(id, arg1); DBManager::instance().DirectQuery("delete from player_shop_items WHERE id='%s'", id); } } else ch->ChatPacket(CHAT_TYPE_INFO, "Shop %s does exists", arg1); } } Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now