MyBB-Plugins Forums

Full Version: [Release] MyRPG 1.2.0
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5 6 7 8 9 10 11
hi again,

i'm newbie at php programming, but in myrpg_user.php in the switch:


Code:
    switch($item['idname'])
    {
        case 'myrpg_axe':
            if (intval($mybb->user['myrpg_attack']) >= intval($mybb->settings['myrpg_attack_max']))
            {
                $buyRtnMsg = $lang->myrpg_attack_not_increased;
                myrpg_fix_stats(intval($mybb->user['uid']), true); // fix all stats
                return false;
            }
            elseif (intval($mybb->user['myrpg_attack']) + intval($mybb->settings['myrpg_axe'])...........


cant use?:

$itemn=$item['idname']

(instead of switch($item['idname']))
and then one block for all the weaps:

Code:
{
            if (intval($mybb->user['myrpg_attack']) >= intval($mybb->settings['myrpg_attack_max']))
            {
                $buyRtnMsg = $lang->myrpg_attack_not_increased;
                myrpg_fix_stats(intval($mybb->user['uid']), true); // fix all stats
                return false;
            }
            elseif (intval($mybb->user['myrpg_attack']) + intval($mybb->settings['$itemn'])...........

where "myrpg_axe" now is $itemn (the name of the item)


maybe is stupid, I said I'm new at php.


getting back to the weapon system subject,

would be posible, if I add new column in items table named "weapon" as a flag,
and if it is activated it make the rpg block code when buying items:


if ($item['weapon'])
{
Code:
(the block of above)


on this way the item would stay in the inventory,
and then add something to decrease the attack if that weapon is sold.

s: sry my bad english and my bad explanations x)
Your logic makes sense yes tho the code would probably not work correctly because it also needs a setting for each item.
I will make a script tonight to allow you to add items into the database. You will also require to do some code edits to get the new items working with MyRPG
I will do this tomorrow. I forgot I didn't install Dreamweaver, neither FileZilla (to upload files to my test forum). I re-installed Windows and there are a few programs that I haven't installed yet.
Dreamweaver installation is nearly completed and it's getting late, the few time it will be opened is for me check a few things to complete the shoutbox guide
; P no problem master

you should take a look for virtual machine (vmware,...) to testing forums and servers,
I do it to test mods for mybb, game servers, other cms's ... is clean and fast x)
I had a virtual machine program before I re-installed Windows 7 (and other OS's) yesterday Tongue
But for testing, I prefer to test it on the internet
So can i add items? or is it impossible
(i can play around with codes if necessary)

Also is there any way i can reinstall the items i deleted (yes i fail)?
I reinstalled myplaza but i think that it is coded into the data base
i have phpmyadmin
No you can't reinstall the items unless you create a script to do so or deactivate and activate MyRPG.

No at the moment you can'add any items
Are you close to finishing the script to add items? no rush at all, I personally won't need it on a long time >.>
The script is done, but I need to write a document to give you instructions. I am busy with school now :/
I´m getting "invalid item" on buyng an AXE

any advice about how to fix this?

Thanks Smile
Pages: 1 2 3 4 5 6 7 8 9 10 11