Announcement

Collapse
No announcement yet.

Help with Donate page to credit an item instead of upping stats

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Help with Donate page to credit an item instead of upping stats

    Ok. I cant seem to get the donator page to actually credit an item to the user.

    I tried
    Code:
    $itemid = 122;	
    $db->query("INSERT INTO inventory VALUES('',$itemid,$userid,1)",$c);

    But it sends the DIE message in my donatordone.php page.
    Anyone have any suggestions? Still new at this whole coding thing. =o)~

  • #2
    Re: Help with Donate page to credit an item instead of upping stats

    It's easier to give support if we know what version of php, mysql, webserver, operating system, and if applicable -- which game engine you're working with.

    I'm assuming it's mccode (vs1 or vs2), but since this isn't posted in the mccode support forum, I can't take it for granted.
    Need a mod for your game? I do work that is second to none. PM me for further details or click on my banner to view my website.

    Comment


    • #3
      Re: Help with Donate page to credit an item instead of upping stats

      Sorry about that...Its pretty close to MC 2...So close in fact I wouldnt be surprised if the guy that sold it copied it from MC and just modded it up...all I have to do to make MC 2 mods work is take out like the top 8 lines and change 1 line and thats it. Consider it MC2.

      Other than that PHP version 5.2.4, MySQL version 4.1.22-standard, Operating system Linux, Apache version 1.3.39 (Unix). Anything else??

      Comment


      • #4
        Re: Help with Donate page to credit an item instead of upping stats

        Try this:

        PHP Code:
        $itemid 122;   
        $db->query("INSERT INTO inventory VALUES('',$itemid,$userid,1)); 
        Note that I took out: ", $c"

        Vs 1 uses mysql_query('query string', $c);
        But vs2 just takes the query string when using the $db class. Looks like someone converted this script from vs1 and missed on little thing.

        If it was you, and for future reference, you don't need to convert mysql_query to $db->query. It normally works without changing that.
        Need a mod for your game? I do work that is second to none. PM me for further details or click on my banner to view my website.

        Comment


        • #5
          Re: Help with Donate page to credit an item instead of upping stats

          Il give it a try. I didnt convert the mysql_query to $db->query btw. Thats just how everything was written in my script so I kept it that way. Didnt know what the $c was for btw....only HALF of my scripts have that. lol
          Il let you know what happens and thanks again for the help. =o)

          Comment


          • #6
            Re: Help with Donate page to credit an item instead of upping stats

            In Version 2 there is an item add fucntion. it merges the items automatically.

            so try this.

            if your using item id 122

            Code:
            item_add($userid,122,1);
            The Break down of this is...

            There are 3 parts.
            $userid == This is the user id of person to recieve it...So if its a post then use $_POST['ID']
            122 == This is the Item ID to give to the user..
            1 == This is the quanity to give...

            So for another example, Lets say this...we will give it to a user using POST method. And going to use a GET method on the Item., and a quanity of 5..

            Code:
            item_add($_POST['ID'],$_GET['ITEM'],5);
            now say the post user id was 3, and the get item was 12,

            User ID 3 would get 5 of the Item ID 12.

            Hope this helps.
            [paypal][email protected][/paypal]
            [progressbar=8,#0000FF,#000000]My Codes[/progressbar]

            Comment

            Working...
            X