josh_boss102 Posted January 1, 2009 Share Posted January 1, 2009 Hi, I have searched the forums all over and I cant seem to find a mod that makes items in the shops.php have a set quantity which is reset every few minutes. So I was wondering if maybe someone has a mod like that and wouldn't mind sharing it with me? Quote Link to comment Share on other sites More sharing options...
POG1 Posted January 1, 2009 Share Posted January 1, 2009 Re: Shops Item Quantity? shops is where you buy items, why would the quantity need to be reset? Quote Link to comment Share on other sites More sharing options...
josh_boss102 Posted January 1, 2009 Author Share Posted January 1, 2009 Re: Shops Item Quantity? I want each item in my shops to have a quantity. And if its sold out of that quantity for each item no one can buy it until after a few min when the quantity for items are reset. It helps bring a balance to the amount of items in circulation. Quote Link to comment Share on other sites More sharing options...
POG1 Posted January 1, 2009 Share Posted January 1, 2009 Re: Shops Item Quantity? Oh ok. Nice idea. ? steps to do it; 1. Add 2 fields to the shop items table, defaultQTY and also add QTY. 2. Edit the shops to work arrround this; buying would need to take the buy qty from the shop item. 3. add a cron to reset the QTY to default QTY. Quote Link to comment Share on other sites More sharing options...
josh_boss102 Posted January 1, 2009 Author Share Posted January 1, 2009 Re: Shops Item Quantity? I really dont know much about programing or mysql other than adding fields...etc so I was wondering if you would be kind enough to show the codes to change or add? Quote Link to comment Share on other sites More sharing options...
Karlos Posted January 1, 2009 Share Posted January 1, 2009 Re: Shops Item Quantity? Hmmm, nice idea.. Quote Link to comment Share on other sites More sharing options...
gurpreet Posted January 1, 2009 Share Posted January 1, 2009 Re: Shops Item Quantity? Oh ok. Nice idea. ? steps to do it; 1. Add 2 fields to the shop items table, defaultQTY and also add QTY. 2. Edit the shops to work arrround this; buying would need to take the buy qty from the shop item. 3. add a cron to reset the QTY to default QTY. I know this is wrong but here's my best attempt. SQL queries ALTER TABLE 'shops' ADD 'defaultQTY' (int)11 NOT NULL default(50); ALTER TABLE 'shops' ADD 'QTY' (int)11 NOT NULL; 2) Can't do yet. 3) For Cron_hour.php $db->query("UPDATE shops SET QTY = QTY =>defaultQTY "); Query is totally wrong but yea, the QTY= QTY=> is supposed to mean set the current QTY to the defaultQTY. Didn't know about the last bit. Quote Link to comment Share on other sites More sharing options...
radio_active Posted January 1, 2009 Share Posted January 1, 2009 Re: Shops Item Quantity? I might code this tommorow or tonight. :-) Quote Link to comment Share on other sites More sharing options...
Karlos Posted January 1, 2009 Share Posted January 1, 2009 Re: Shops Item Quantity? 3. add a cron to reset the QTY to default QTY. Why do that? Maybe start off like 500 defaultQTY why not use a rand() like: $QuantRand = rand(100, 250); $AddQuant = sprintf("UPDATE `shops` SET `QTY` = ('%u')" ,$QuantRand); $db->query ($AddQuant); Reason Why? Then you don't have a definite QTY that comes back. Personally add it to something which would suit your games economy.. Quote Link to comment Share on other sites More sharing options...
gurpreet Posted January 1, 2009 Share Posted January 1, 2009 Re: Shops Item Quantity? 3. add a cron to reset the QTY to default QTY. Why do that? Maybe start off like 500 defaultQTY why not use a rand() like: $QuantRand = rand(100, 250); $AddQuant = sprintf("UPDATE `shops` SET `QTY` = ('%u')"); $db->query ($AddQuant); Reason Why? Then you don't have a definite QTY that comes back. Personally add it to something which would suit your games economy.. If you think about it, in real life, shops get a certain amount of stock every certain amount of days, so for mine when it's done, it would get say 100 of each item every 3 or 4 days. Also what does the %u do? Quote Link to comment Share on other sites More sharing options...
Karlos Posted January 1, 2009 Share Posted January 1, 2009 Re: Shops Item Quantity? Try looking at it now....should make more sense....im not with it atm, but should be correct aswell now. Quote Link to comment Share on other sites More sharing options...
03laceys Posted January 1, 2009 Share Posted January 1, 2009 Re: Shops Item Quantity? This was coded before and i belive released as a paid modification. Quote Link to comment Share on other sites More sharing options...
Karlos Posted January 1, 2009 Share Posted January 1, 2009 Re: Shops Item Quantity? This was coded before and i belive released as a paid modification. Yea, don't stop anyone making a free version... :roll: Quote Link to comment Share on other sites More sharing options...
ishmell Posted January 1, 2009 Share Posted January 1, 2009 Re: Shops Item Quantity? Yeh, this is a great idea. Sounds like it would make a great mod. Quote Link to comment Share on other sites More sharing options...
josh_boss102 Posted January 1, 2009 Author Share Posted January 1, 2009 Re: Shops Item Quantity? So many posts im most grateful. It would be really great if someone did make it. And I do have more ideas if you guys are interested xD Quote Link to comment Share on other sites More sharing options...
Karlos Posted January 1, 2009 Share Posted January 1, 2009 Re: Shops Item Quantity? Hit me up on MSN: [email protected] Quote Link to comment Share on other sites More sharing options...
radio_active Posted January 2, 2009 Share Posted January 2, 2009 Re: Shops Item Quantity? http://criminalexistence.com/ceforums/i ... ic=27467.0 Its been made Josh, the update is about 10 posts down so grab the edited version.. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.