-
Posts
2,392 -
Joined
-
Last visited
-
Days Won
62
Content Type
Profiles
Forums
Events
Everything posted by Sim
-
I need an extra set of eyes: a number see what I'm missing. I been starting at screen to long. $db->prepare(" INSERT INTO crimes ( C_name, C_success, C_fail, C_convictMsg, C_victimMsg, C_cooldown, C_money, C_maxMoney, C_level, C_bullets, C_maxBullets, C_exp, C_playerPerc, C_itemType, C_itemID, C_itemChance, C_itemPlayerChance, C_itemLoose, C_reqItemType ) VALUES ( :name, :success, :fail, :convictMsg, :victimMsg, :cooldown, :money, :maxMoney, :level, :bullets, :maxBullets, :exp, :playerPerc :itemType, :itemID, :itemChance, :itemPlayerChance, :itemLoose, :reqItemType ); "); if(empty ($this->methodData->itemLoose)){ $itemLoose = 'y'; } else { $itemLoose = 'n'; } if(empty ($this->methodData->reqItemType)){ $reqItemType = 'y'; } else { $reqItemType = 'n'; } $insert->bindParam(":name", $this->methodData->name); $insert->bindParam(":cooldown", $this->methodData->cooldown); $insert->bindParam(":money", $this->methodData->money); $insert->bindParam(":maxMoney", $this->methodData->maxMoney); $insert->bindParam(":level", $this->methodData->level); $insert->bindParam(":bullets", $this->methodData->bullets); $insert->bindParam(":maxBullets", $this->methodData->maxBullets); $insert->bindParam(":exp", $this->methodData->exp); $insert->bindParam(":success", $this->methodData->success); $insert->bindParam(":fail", $this->methodData->fail); $insert->bindParam(":convictMsg", $this->methodData->convictMsg); $insert->bindParam(":victimMsg", $this->methodData->victimMsg); $insert->bindParam(":playerPerc", $this->methodData->playerPerc); $insert->bindParam(":itemChance", $this->methodData->itemChance); $insert->bindParam(":itemPlayerChance", $this->methodData->itemPlayerChance); $insert->bindParam(":itemType", $this->methodData->itemType); $insert->bindParam(":itemID", $this->methodData->itemID); $insert->bindParam(":itemLoose", $itemLoose); $insert->bindParam(":reqItemType", $reqItemType); $insert->execute();
-
Yo should have done coded a URL blocking
-
@John Ellison this is a good mod.
-
Anyone got a 2 column ACP TPL they willing to share. I rather use 2 column for some mods coming up instead of one? I believe it would be better looking instead of straight list of data entry.
-
I'll let you know very shortly. Nice work! That knocked about 60 lines of code off. 🙂 But here's the errors I kept running into before. The reason I did it the way I did it I think Edit: now that I'm fully awake, I need two queries. One gets all items in game(black market) whole other gets users inventory. Maybe this will be able to help me though foreach ($inv as $inventory) { $allItems['type'][$inventory->type]['item'][] = [ 'id' => $inventory->item_id, 'name' => $inventory->name, ] } Edit: latest vardump, code and errors //get items $rec = $this->db->prepare(" SELECT I_id AS itemID, I_name AS name, I_rank as 'rank', ROUND(I_damage / 100, 2) as 'damage', IT_id AS 'typeID', IT_name as 'type' FROM itemTypes JOIN items WHERE I_type=IT_id ORDER BY IT_id ASC "); $rec->execute(); $items = $rec->fetchAll(PDO::FETCH_ASSOC); $allItems = []; foreach ($items as $item) { $allItems['type'][$item['type']]['item'][] = [ 'id' => $item['itemID'], 'name' => $item['name'] ]; } var_dump($allItems); $this->html .= $this->page->buildElement("blackMarket", array( "location" => $this->user->getLocation(), "inventory" => $inv, "itemType" => $allItems )); [/Code] array(1) { ["type"]=> array(4) { ["Weapon"]=> array(1) { ["item"]=> array(3) { [0]=> array(2) { ["id"]=> string(1) "7" ["name"]=> string(9) "Smokiness" } [1]=> array(2) { ["id"]=> string(1) "4" ["name"]=> string(8) "Ball bat" } [2]=> array(2) { ["id"]=> string(1) "1" ["name"]=> string(11) "Test weapon" } } } ["Armor"]=> array(1) { ["item"]=> array(3) { [0]=> array(2) { ["id"]=> string(1) "5" ["name"]=> string(7) "Testers" } [1]=> array(2) { ["id"]=> string(1) "3" ["name"]=> string(11) "Test Armour" } [2]=> array(2) { ["id"]=> string(1) "8" ["name"]=> string(10) "Will other" } } } ["Hat"]=> array(1) { ["item"]=> array(1) { [0]=> array(2) { ["id"]=> string(1) "6" ["name"]=> string(9) "Hhhhsjshd" } } } ["Shoe"]=> array(1) { ["item"]=> array(1) { [0]=> array(2) { ["id"]=> string(1) "2" ["name"]=> string(19) "First edition Nikes" } } } } } The log file minor.txt is not writable! There was an error! File: /home/simmakew/public_html/GL/class/templateRender.php Line: 86 Error: htmlspecialchars() expects parameter 1 to be string, array given Type: E_RECOVERABLE_ERROR There was an error! File: /home/simmakew/public_html/GL/class/templateRender.php Line: 90 Error: Variable passed to each() is not an array or object Type: E_RECOVERABLE_ERROR I can't access the code thing to add code in posts as code tag
-
That's awesome.
-
That don't fix anything. Thought that was definitely the problem. I done tried many variations of the array to.
-
Still don't work. My TPL public $blackMarket = ' <div class="panel panel-default"> <div class="panel-heading">{location} Black Market</div> <div class="panel-body"> <div class="row"> <div class="col-md-6"> <h4>INVENTORY</h4> {#each inventory} <div class="crime-holder"> <p> <span class="action"> {name} </span> <span class="cooldown"> {type} {/if} </span> <span class="commit"> <a href="?page=blackmarket&action=sell&item={id}">Sell</a> </span> </p> </div> {/each} {#unless inventory} <div class="text-center"> <em>There are no weapons for you to buy</em> </div> {/unless} </div> {each itemType} <div class="col-md-6"> <h4>{type}</h4> {#each item} <div class="crime-holder"> <p> <span class="action"> {name} </span> <span class="cooldown"> {#if cost} ${number_format cost} {/if} {#if points} {#if cost} + {/if} {number_format points} {_setting "pointsName"} {/if} </span> {#unless cantBuy} <span class="commit"> {#if owned} Owned {/if} {#unless owned} <a href="?page=blackmarket&action=buy&item={id}"> Buy </a> {/unless} </span> {/unless} </p> </div> {/each} {#unless item} <div class="text-center"> <em>There is no armor to buy</em> </div> {/unless} </div> </div> {/each} </div> </div> ';
-
Lol.. sorry. But that is a good idea.
-
Lol.. it was sounding good so keep hitting the middle button
-
Any developers trying to trade paid mods? I'll trade any of my mods for any of your mods if I am interested in any of them. Reply with which of my mods to would like and I will check your mods out to see what and which ones I would like.
-
The price has been raised back up to $10.00 due to several new features about to be added. As well as taking from players during crimes and the new messages. Game users can now reward items or a random item from an item type. This option allows the item to be taken from another player. There is also an option that requires an item type to commit the crime and option to loose the item if fails the crime.
-
I just refund this place a month or two ago
-
Welcome back. They should send a mass email. I didn't realize MWG was back till a year later myself.
-
public function constructModule() { //get user inventory first $rec = $this->db->prepare(" SELECT IV_id AS 'id', IV_quantity AS 'amount', IT_name as 'type', I_name AS name, I_rank as 'rank', ROUND(I_damage / 100, 2) as 'damage' FROM inventory JOIN items JOIN itemTypes WHERE IV_userID=:user AND I_id = IV_itemID AND IT_id = I_type "); $rec->bindParam(":user", $this->user->id); $rec->execute(); //$allItems = array(); $inv = $rec->fetchAll(PDO::FETCH_ASSOC); //get item types $types = $this->db->prepare(" SELECT IT_id AS 'id', IT_name as 'type' FROM itemTypes ORDER BY IT_id ASC "); $types->execute(); $allItems = array(); while($type = $types->fetchObject()) { $allItems[]["type"] = $type->type; $items = $this->db->prepare(" SELECT I_id AS id, I_name AS name, I_rank as 'rank', ROUND(I_damage / 100, 2) as 'damage' FROM items WHERE I_type=:typeID "); $items->bindParam(":typeID", $type->id); $items->execute(); while($item = $items->fetchObject()) { $allItems[]["item"]["name"] = $item->name; $allItems[]["item"]["id"] = $item->id; } //$allItems[]->item = $item; } var_dump($allItems); $this->html .= $this->page->buildElement("blackMarket", array( "location" => $this->user->getLocation(), "inventory" => $inv, "itemType" => $allItems )); } My vardump of $allItems: array(12) { [0]=> array(1) { ["type"]=> string(6) "Weapon" } [1]=> array(1) { ["item"]=> array(1) { ["name"]=> string(11) "Test weapon" } } [2]=> array(1) { ["item"]=> array(1) { ["id"]=> string(1) "1" } } [3]=> array(1) { ["item"]=> array(1) { ["name"]=> string(8) "Ball bat" } } [4]=> array(1) { ["item"]=> array(1) { ["id"]=> string(1) "4" } } [5]=> array(1) { ["type"]=> string(5) "Armor" } [6]=> array(1) { ["item"]=> array(1) { ["name"]=> string(11) "Test Armour" } } [7]=> array(1) { ["item"]=> array(1) { ["id"]=> string(1) "3" } } [8]=> array(1) { ["type"]=> string(3) "Hat" } [9]=> array(1) { ["type"]=> string(4) "Shoe" } [10]=> array(1) { ["item"]=> array(1) { ["name"]=> string(19) "First edition Nikes" } } [11]=> array(1) { ["item"]=> array(1) { ["id"]=> string(1) "2" } } } The problem is I can't get the items to show. The inventory shows.
-
That's the only reason I have made this mod. I already had the majority of my code done for it from the user Aaction log mod I released.
-
Maybe list the award types people can choose? Mod looks great. The Add new mod is really a wonderful piece of work to. I bet people would like it even more if name could automatically be placed on the badge? People like me stuck at art. And I really dislike getting charged arm and a leg for art when I'm always giving great rates on programming myself.
-
This price has been reduced to $6.00
-
This price has been reduced to $6.00
-
This price has been reduced to $6.00
-
This price has been reduced to $6.00
-
I guess your pulling the data from the database?
-
Certain files do require file edits as the hook codes in some of the GL files send the wrong data or error completely. See this thread for fixes I posted. The mod looks great. It was on my to-do list.