Jump to content
MakeWebGames

Various issues


Sim

Recommended Posts

I'm going to use this topic for various small encounters I have.

 

DATA:

 
array(4) { [0]=> array(11) { ["invID"]=> string(2) "30" ["itemID"]=> string(1) "1" ["name"]=> string(14) "Military knife" ["fileType"]=> string(4) ".png" ["height"]=> string(3) "100" ["width"]=> string(3) "100" ["price"]=> string(2) "32" ["value"]=> string(2) "17" ["types"]=> string(6) ":0:24:" ["slot"]=> string(18) "LEFT Handed Weapon" ["slotID"]=> string(2) "10" } [1]=> array(2) { ["slot"]=> string(8) "Headware" ["slotID"]=> string(2) "11" } [2]=> array(11) { ["invID"]=> string(2) "14" ["itemID"]=> string(1) "3" ["name"]=> string(11) "Claw Hammer" ["fileType"]=> string(4) ".png" ["height"]=> string(3) "100" ["width"]=> string(3) "100" ["price"]=> string(2) "21" ["value"]=> string(1) "8" ["types"]=> string(6) ":0:24:" ["slot"]=> string(7) "Special" ["slotID"]=> string(2) "32" } [3]=> array(2) { ["slot"]=> string(19) "Right handed weapon" ["slotID"]=> string(2) "35" } }
 $equipedItems = $this->getPlayerSlotInfo($userID);
    
   debug(var_dump($equipedItems));
    foreach($equipedItems as $item)
    {
      
      //debug($item);
      if(!empty($item["types"]))
      {
        $iTypes = explode(":", $item['types']);
       
        $types = "";
        debug($item);
        
        for($z=1;$z<count($iTypes)-1;$z++){
          $type = "";
          if($iTypes[$z] != 0 && $iTypes != ""){
            $type = $this->getItemType($iTypes[$z]);
           //debug($type);
            if($type['parentID'] == "Weapon")
            {
              debug("Weapon");
              unset($item);
              break 1;
            }
          }
        }
      }
    }

 

The problem is it shows WEAPON 4X WHEN IT SHOULD ONLY BE DONE

Complete debug DATA:

 

 

Nevermind. I just hire realized I was curious do in the method twice so double the days and was deciding this for hours.

Link to comment
Share on other sites

//THIS A SNIPPLET

$mainType = new $data['parentID']($data);
      debug("test"); 
      debug(var_dump($mainType));
        //EXTRA DATA
        $extraData = $mainType->getAdminHTML();
        debug("test");
        debug($extraData);
        if($extraData != "")
        { debug("test");
          return $this->createNewItemTypeWithExtraData($mainType, $data, "new");
        }
        

The problem occurs when I call the method. Not while initiating the class.

 

File: /home/simmakew/public_html/GL/modules/installed/itemTypes/Types/ItemTypes.interface.php
Line: 3
Error: Cannot declare interface Item_Type, because the name is already in use
Type: E_RECOVERABLE_ERROR

Anyone got any ideas?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...