Сообщение от
Londlem
Поделитесь решением.
Код дно у меня, поэтому если что, то...
PHP код:
publics: Orders_Product(playerid)
{
static rows, fields;
new string[285];
new prod = GetPVarInt(playerid, "OrdersProd");
new price = prod;
new id = PlayerInfo[playerid][pBusiness];
cache_get_data(rows, fields);
if(rows)
{
SendClientMessage(playerid, COLOR_GRAY, "Ваш заказ уже есть в базе, ожидайте доставки!");
return true;
}
else
{
mysql_format(connects, string, sizeof(string), "INSERT INTO `orders_product` VALUES ('%d', '%s', '%d')", BusinessInfo[id][bID], BusinessInfo[id][bName], prod);
mysql_function_query(connects, string, false, "", "");
TransferMoney(playerid, -1, price*3, "orderbusiprod");
SendClientMessage(playerid, COLOR_GREEN, "Товар заказан, ожидайте доставки");
}
mysql_function_query(connects, "SELECT * FROM `orders_product`", true, "Load_OrdersProduct", "");
return true;
}