20.10.2011, 16:04
So I got this code:
But when doing it ingame all I get is:
"You have ordered [ 40 ] of"
and it stopts there. So there's something wrong with "Product" or %s. I can't really figure that so I hope someone can help me with it.
Код:
CMD:orderproduct(playerid, params[]) { new ProductID, Product[128], AmountDeProduct, ProductSlot, ProductPrice, x, string[128]; x = getPlayerBusinessID(playerid); if(playerVariables[playerid][pNormalName] == businessVariables[x][bOwner]) { if(sscanf(params, "dddd", ProductID, AmountDeProduct, ProductPrice, ProductSlot)) return SendClientMessage(playerid, COLOR_GREY, SYNTAX_MESSAGE"/orderproduct [Product ID] [Amount] [Product Price] [ProductSlot]"); if(businessVariables[x][bType] == 1) { if(systemItems[ProductID][iType] > 5) return SendClientMessage(playerid, COLOR_GREY, "You can only order products from Type 1-5, check /itemslist to see which products you can order"); if(ProductSlot == 1) { systemItems[ProductID][iName] = Product; Product = businessVariables[x][bProduct1]; businessVariables[x][bProductAmount1] = AmountDeProduct; businessVariables[x][bProductPrice1] = ProductPrice; saveBusiness(x); format(string, sizeof(string), "You have ordered [ %d ] of %s on slot %d and set their price to $ %d", businessVariables[x][bProductAmount1], Product, ProductSlot, businessVariables[x][bProductPrice1]); SendClientMessage(playerid, COLOR_GREY, string); } else { SendClientMessage(playerid, COLOR_GREY, "you dumb as hell"); } } } else { SendClientMessage(playerid, COLOR_GREY,"You do not own any businesses"); } return 1; }
"You have ordered [ 40 ] of"
and it stopts there. So there's something wrong with "Product" or %s. I can't really figure that so I hope someone can help me with it.