Jump to content
MakeWebGames

Some Body Help Me Plz


pspotential

Recommended Posts

Fatal error: Cannot redeclare item_remove() (previously declared in C:\Domains\psp-customs.com\wwwroot\mafialegends\itemmarket.php:48) in C:\Domains\psp-customs.com\wwwroot\mafialegends\global_func.php on line 323

i get tht error when trying to access item market anyone got any ideas how to fix it :mrgreen: :mrgreen:

EDIT:FIXED

P.S if your like me ad think how the hell did you fix it when you see people posting fixed i suggest your search this site (like i should of in the first place) you will find your answer

Link to comment
Share on other sites

  • 1 month later...

Re: Some Body Help Me Plz

NO, that fix posted there is bad. It actually removes the item_remove function in itemmarket.php so you cant take items off the itemmarket!

Use this fix instead (on a clean v2 itemmarket.php with the redeclaring glitch still there):

Find:

function item_remove()

Replace With:

function itemm_remove()

Find:

case "remove":
item_remove();

Replace With:

case "remove":
itemm_remove();
Link to comment
Share on other sites

  • 3 weeks later...

Re: Some Body Help Me Plz

that function is actually backwards, here's a working one:

 

function itemm_remove()
{
global $db,$ir,$c,$userid,$h;
$q=$db->query("SELECT im.*,i.* FROM itemmarket im LEFT JOIN items i ON im.imITEM=i.itmid WHERE imID={$_GET['ID']} AND imADDER=$userid");
if(!$db->num_rows($q))
{
print "Error, either this item does not exist, or you are not the owner.

[url='itemmarket.php']> Back[/url]";
}
$r=$db->fetch_row($q);
item_add($userid, $r['imITEM'], 1);
$i=($db->insert_id()) ? $db->insert_id() : 99999;
$db->query("DELETE FROM itemmarket WHERE imID={$_GET['ID']}");
$db->query("INSERT INTO imremovelogs VALUES ('', {$r['imITEM']}, {$r['imADDER']}, $userid, {$r['imID']}, $i, unix_timestamp(), '{$ir['username']} removed a {$r['itmname']} from the item market.')");
print "Item removed from market!

[url='itemmarket.php']> Back[/url]";
$h->endpage();
exit;
}
Link to comment
Share on other sites

  • 3 weeks later...

Re: Some Body Help Me Plz

Just to be clear about this fix, after doing this, :

 

 

that function is actually backwards, here's a working one:

 

function itemm_remove()
{
global $db,$ir,$c,$userid,$h;
$q=$db->query("SELECT im.*,i.* FROM itemmarket im LEFT JOIN items i ON im.imITEM=i.itmid WHERE imID={$_GET['ID']} AND imADDER=$userid");
if(!$db->num_rows($q))
{
print "Error, either this item does not exist, or you are not the owner.

[url='itemmarket.php']> Back[/url]";
}
$r=$db->fetch_row($q);
item_add($userid, $r['imITEM'], 1);
$i=($db->insert_id()) ? $db->insert_id() : 99999;
$db->query("DELETE FROM itemmarket WHERE imID={$_GET['ID']}");
$db->query("INSERT INTO imremovelogs VALUES ('', {$r['imITEM']}, {$r['imADDER']}, $userid, {$r['imID']}, $i, unix_timestamp(), '{$ir['username']} removed a {$r['itmname']} from the item market.')");
print "Item removed from market!

[url='itemmarket.php']> Back[/url]";
$h->endpage();
exit;
}

 

 

You must still do this:

Find:

Code:

case "remove":

item_remove();Replace With:

Code:

case "remove":

itemm_remove();

 

Then, your players will be able to remove items from the market.

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...