jcvenom Posted June 7, 2015 Posted June 7, 2015 (edited) I was thinking of building this award system for mccodes which i have currently made for my engine what do yous think? Features Content loaded with js Over 160 awards and honors to unlock Easy installation Provide support if needed(Updated due to Veramis question :) ) Award cron Awards on profile Staff log for awards Cost Im basing the price on the duration it took for me to make the mod so im selling this mod at 20 pounds Includes full installation if needed what do you guys think? I will make mods like wordwar etc if this goes well [ATTACH=CONFIG]2091[/ATTACH] [ATTACH=CONFIG]2092[/ATTACH] [ATTACH=CONFIG]2093[/ATTACH] [ATTACH=CONFIG]2094[/ATTACH] [ATTACH=CONFIG]2095[/ATTACH] [ATTACH=CONFIG]2096[/ATTACH] Edited June 8, 2015 by jcvenom Quote
realmoflegends Posted June 7, 2015 Posted June 7, 2015 (edited) That's a great idea! Tad bit expensive in my eyes, but nice. Edited June 7, 2015 by realmoflegends Quote
Veramys Posted June 8, 2015 Posted June 8, 2015 How does one promise 24/7 support. I never really understood that unless it was a bigger business. Quote
jcvenom Posted June 8, 2015 Author Posted June 8, 2015 How does one promise 24/7 support. I never really understood that unless it was a bigger business. I suppose you could say that :P, but instead i will say i will provide support if needed Quote
Jimbo Posted June 8, 2015 Posted June 8, 2015 Love the idea and if it works how described it would be worth the price. At least I would pay for it lol Quote
NonStopCoding Posted June 8, 2015 Posted June 8, 2015 i think the price is to high too 20 gbp per sale but looking nice project price / expected amount of sales = sale price i use this to work out a rough price for my modules Quote
sniko Posted June 8, 2015 Posted June 8, 2015 i think the price is to high too 20 gbp per sale but looking nice project price / expected amount of sales = sale price i use this to work out a rough price for my modules 20GBP isn't too expensive for someones time. [MENTION=69823]jcvenom[/MENTION] how flexible are the awards? Ie: Do you have to hardcode the criteria or can you put the awards into a database and they'll get given via cron logic? Quote
jcvenom Posted June 8, 2015 Author Posted June 8, 2015 (edited) 20GBP isn't too expensive for someones time. [MENTION=69823]jcvenom[/MENTION] how flexible are the awards? Ie: Do you have to hardcode the criteria or can you put the awards into a database and they'll get given via cron logic? The awards are not hard coded all they require is a class, in the staff panel you can create the award and add a class(the list of classes that come with the mod will be listed in a file, there are 17 default classes because ive already added 160 awards, so you can change them or add more if you want) for example the class for attack = 1; so if i wanted to create an award for attack i'd create the award and give it a class of 1, it then loads class one from memeber_awards and loads it into the file and so on. The only thing that is hard coded is how your awards work, e.g you attack a certain user it logs it into a table once a cron then runs and the user gains the award its a very workable system. Since im building it for v2 if any changes are wanted feel free to post here and i will look into adding or removing them, i hope that answers your question [MENTION=65371]sniko[/MENTION] :) Edited June 8, 2015 by jcvenom Quote
Dayo Posted June 8, 2015 Posted June 8, 2015 If i were coding this i would first make a system to store and show stats, then once you have this then code the achievements on top. Something like <?php /* CREATE TABLE `statistics` ( `user` int PRIMARY KEY, `type` int PRIMARY KEY, `success` int, `fail` int ); CREATE TABLE `statisticTypes` ( `id` int PRIMARY KEY AUTO_INCREMENT, `name` varchar(255) ); */ class Stats { public function __construct($uid = false) { //$database_connection = new PDO(); $this->db = $database_connection; if ($uid) { $this->uid = $uid; } else { $this->uid = $_SESSION["uid"]; } } private function addNewType($typeName) { $insertType = $this->db->prepare("INSERT INTO `statisticTypes` (`id`, `name`) VALUES (NULL, :name);"); $insertType->bindParam(":name", $typeName); $insertType->execute(); return $this->db->lastInsertId(); } private function getTypeID($typeName) { $selectType = $this->db->prepare("SELECT `id` FROM `statisticTypes` WHERE `name` = :name"); $selectType->bindParam(":name", $typeName); $selectType->execute(); $type = $selectType->fetch(PDO::FETCH_ASSOC); if (!empty($type["id"]) { return $type["id"]; } else { return $this->addNewType($typeName); } } private function insert($typeName, $success = false) { $typeID = $this->getTypeID($typeName); $col = ($success?"success":"fail"); $altCol = ($success?"fail":"success"); $updateStat = $this->db->prepare("UPDATE `statistics` SET `".$col."`=`".$col."`+1 WHERE `user` = :uid AND `type` = :type"); $updateStat->bindParam(":uid", $this->uid); $updateStat->bindParam(":type", $typeID); if (!$updateStat->execute()) { $insertStat = $this->db->prepare("INSERT INTO `statistics` (`user`, `type`, `".$col."`, `".$altCol."`) VALUES (:user, :type, 1, 0);"); $insertStat->bindParam(":uid", $this->uid); $insertStat->bindParam(":type", $typeID); $insertStat->execute(); } } public function fail($typeName) { $this->insert($typeName, false); } public function success($typeName) { $this->insert($typeName, true); } }; $attacker = new Stats($user1); $defender = new Stats($user2); $attacker->fail("attack"); $defender->success("defence"); Ive just thrown this together untested so will need some work. If you coded it like this module makers could implement it without doing anything in the database. Quote
jcvenom Posted June 8, 2015 Author Posted June 8, 2015 If i were coding this i would first make a system to store and show stats, then once you have this then code the achievements on top. Something like <?php /* CREATE TABLE `statistics` ( `user` int PRIMARY KEY, `type` int PRIMARY KEY, `success` int, `fail` int ); CREATE TABLE `statisticTypes` ( `id` int PRIMARY KEY AUTO_INCREMENT, `name` varchar(255) ); */ class Stats { public function __construct($uid = false) { //$database_connection = new PDO(); $this->db = $database_connection; if ($uid) { $this->uid = $uid; } else { $this->uid = $_SESSION["uid"]; } } private function addNewType($typeName) { $insertType = $this->db->prepare("INSERT INTO `statisticTypes` (`id`, `name`) VALUES (NULL, :name);"); $insertType->bindParam(":name", $typeName); $insertType->execute(); return $this->db->lastInsertId(); } private function getTypeID($typeName) { $selectType = $this->db->prepare("SELECT `id` FROM `statisticTypes` WHERE `name` = :name"); $selectType->bindParam(":name", $typeName); $selectType->execute(); $type = $selectType->fetch(PDO::FETCH_ASSOC); if (!empty($type["id"]) { return $type["id"]; } else { return $this->addNewType($typeName); } } private function insert($typeName, $success = false) { $typeID = $this->getTypeID($typeName); $col = ($success?"success":"fail"); $altCol = ($success?"fail":"success"); $updateStat = $this->db->prepare("UPDATE `statistics` SET `".$col."`=`".$col."`+1 WHERE `user` = :uid AND `type` = :type"); $updateStat->bindParam(":uid", $this->uid); $updateStat->bindParam(":type", $typeID); if (!$updateStat->execute()) { $insertStat = $this->db->prepare("INSERT INTO `statistics` (`user`, `type`, `".$col."`, `".$altCol."`) VALUES (:user, :type, 1, 0);"); $insertStat->bindParam(":uid", $this->uid); $insertStat->bindParam(":type", $typeID); $insertStat->execute(); } } public function fail($typeName) { $this->insert($typeName, false); } public function success($typeName) { $this->insert($typeName, true); } }; $attacker = new Stats($user1); $defender = new Stats($user2); $attacker->fail("attack"); $defender->success("defence"); Ive just thrown this together untested so will need some work. If you coded it like this module makers could implement it without doing anything in the database. I havent coded it in OOP php, and im dont really have much experience in OOP php i never had time to learn it looks very complex Quote
sniko Posted June 8, 2015 Posted June 8, 2015 I havent coded it in OOP php, and im dont really have much experience in OOP php i never had time to learn it looks very complex It's a great way to create easily-extendible, organised applications involving the DRY principle. Also, you can have some fun with it ;) https://eval.in/377301 Quote
jcvenom Posted June 8, 2015 Author Posted June 8, 2015 It's a great way to create easily-extendible, organised applications involving the DRY principle. Also, you can have some fun with it ;) https://eval.in/377301 I know most of the basics of OOP but when you get to things like the static operator ( :: ) and stuff like that and PDO i question why i bothered learning the original php in the first place, OOP looks like another long chapter of a book Quote
sniko Posted June 8, 2015 Posted June 8, 2015 I know most of the basics of OOP but when you get to things like the static operator ( :: ) and stuff like that and PDO i question why i bothered learning the original php in the first place, OOP looks like another long chapter of a book Static means you can call the property/method without instantiating the object. It's quite handy. See: http://verraes.net/2014/06/when-to-use-static-methods-in-php/ Quote
NonStopCoding Posted June 8, 2015 Posted June 8, 2015 20GBP isn't too expensive for someones time. [MENTION=69823]jcvenom[/MENTION] how flexible are the awards? Ie: Do you have to hardcode the criteria or can you put the awards into a database and they'll get given via cron logic? i just meant me in general i believe the price is to high for me but everyone has there own opinions and prices Quote
jcvenom Posted June 8, 2015 Author Posted June 8, 2015 i just meant me in general i believe the price is to high for me but everyone has there own opinions and prices This is an estimate, when i complete the mod i may lower the price slightly Quote
NonStopCoding Posted June 8, 2015 Posted June 8, 2015 This is an estimate, when i complete the mod i may lower the price slightly it is a nice mod i would like to see it in action when its completed :p Quote
jcvenom Posted June 8, 2015 Author Posted June 8, 2015 it is a nice mod i would like to see it in action when its completed :p Thank you :), i just want to bring the engine to life again hehe Quote
sniko Posted June 9, 2015 Posted June 9, 2015 This is an estimate, when i complete the mod i may lower the price slightly I wouldn't. You will need to cover the cost of your investment (your time) You will need to cover the cost of the "24/7 support" But hey, it's up to you... Quote
jcvenom Posted June 9, 2015 Author Posted June 9, 2015 I wouldn't. You will need to cover the cost of your investment (your time) You will need to cover the cost of the "24/7 support" But hey, it's up to you... Yeh i get you Quote
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.