vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.8 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=235)
-   -   Add-On Releases - vBArmy - vBulletin Army System (https://vborg.vbsupport.ru/showthread.php?t=208977)

NavS 04-08-2009 02:29 AM

Also changed line 114 of viewplayer.php to
PHP Code:

$GoldLost=round(rand(0,$LoserInfo['gold']/4)); 

now players wont be devestated when they loose like half or all the money they saved up... now they will loose between 0 and 1/4 of the money they have.

can also be changed to like loose 1/10 of the money since you get multiple turns...
PHP Code:

$GoldLost=round($LoserInfo['gold']/10); 


NavS 04-08-2009 02:32 AM

if you get no spies no nothing remember to go into admin panel of the game and edit game settings and just save so it'll put all that info in... then reset the game and join your alliance again.

NavS 04-08-2009 02:50 AM

hmn so that / turn thing and the .5 round up in selling is all thats left?

Blackhat 04-08-2009 11:28 AM

Thanks :)

Blackhat 04-09-2009 07:43 AM

anyway too send a pm when reset ?

Sugoi na 04-09-2009 12:15 PM

Quote:

Originally Posted by NavS (Post 1786242)
fix that by adding
PHP Code:

OR $totalcost<

to line 13 of intelligence.php

also fix negative turns with the
PHP Code:

OR $att->clean['turns']<

to line 73 of viewplayer.php

Maybe you should ping the author since he is looking for a bit of help on this mod =)

I think with quicker updates & improvements, this mod reach the arcade systems fame.

Keep up the great work if not!

NavS 04-11-2009 12:10 AM

for the being able to sell .5 of something change the selling items section of armory.php. This isn't really a solution but it fixes the problem, users won't be able to sell one of something only 2+

PHP Code:

//****
//Process Selling Items
//****
$att->clean(p,'posted2',str);
if(
$att->clean['posted2']=='yes')
{
    
//begin sell

    
$SellWeaponArray=array();
    
$SellArmorArray=array();

    foreach(
$InventoryWeaponArray as $value)
    {
        
$att->clean(p,"sellweapon$value[id]",uint);
        if(
$att->clean["sellweapon$value[id]"]>$value['quantity'] OR $value['quantity']<2)
        {
            
standard_error("You do not have that many items to sell");
        }
        if(
$att->clean["sellweapon$value[id]"]>0)
        {
            
$SellWeaponArray[$value['itemid']]=$att->clean["sellweapon$value[id]"];
        }
    }

    foreach(
$InventoryArmorArray as $value)
    {
        
$att->clean(p,"sellarmor$value[id]",uint);
        
        if(
$att->clean["sellarmor$value[id]"]>0)
        {
            
$SellArmorArray[$value['itemid']]=$att->clean["sellarmor$value[id]"];
        }
        if(
$att->clean["sellarmor$value[id]"]>$value['quantity'] OR $value['quantity']<2)
        {
            
standard_error("You do not have that many items to sell");
        }
    }

    
//calculate total reimbursement
    
$TotalSellValue=0;
    foreach(
$SellWeaponArray as $key=>$value)
    {
        
$SellValue=0;
        
$SellValue=round($WeaponList[$key]['cost']-$WeaponList[$key]['cost']*$WeaponList[$key]['sellpenalty']/100);
        if(
$SellValue<0)
        {
            
$SellValue=0;
        }
            
$TotalSellValue=$TotalSellValue+$SellValue*$value;
    }
    foreach(
$SellArmorArray as $key=>$value)
    {
        
$SellValue=0;
        
$SellValue=round($ArmorList[$key]['cost']-$ArmorList[$key]['cost']*$ArmorList[$key]['sellpenalty']/100);
        if(
$SellValue<0){
            
$SellValue=0;
        }
        
$TotalSellValue=$TotalSellValue+$SellValue*$value;
    }

    
//give money
    
$NewGoldAmount=$playerinfo['gold']+$TotalSellValue;
    
$data->set(as_user);
    
$data->update(gold,$NewGoldAmount);
    
$data->where(id,$playerinfo['id']);
    
$data->execute(update);
    
//end give money
    //complete order.
    
foreach($SellWeaponArray as $key=>$value)
    {
        
$data->set(as_inventory);
        
$data->select('*');
        
$data->where(playerid,$playerinfo['id']);
        
$data->where(item,'weapon');
        
$data->where(itemid,$key);
        
$SellInfo=$data->execute(select1);

        
$NewQuantity=$SellInfo['quantity']-$value;

        if(
$NewQuantity==0){
            
$data->set(as_inventory);
            
$data->delete();
            
$data->where(playerid,$playerinfo['id']);
            
$data->where(item,'weapon');
            
$data->where(itemid,$key);
            
$data->execute(delete);
        }else{
            
$data->set(as_inventory);
            
$data->update(quantity,$NewQuantity);
            
$data->where(playerid,$playerinfo['id']);
            
$data->where(item,'weapon');
            
$data->where(itemid,$key);
            
$data->execute(update);
        }
    }
    foreach(
$SellArmorArray as $key=>$value)
    {

        
$data->set(as_inventory);
        
$data->select('*');
        
$data->where(playerid,$playerinfo['id']);
        
$data->where(item,'armor');
        
$data->where(itemid,$key);
        
$SellInfo=$data->execute(select1);

        
$NewQuantity=$SellInfo['quantity']-$value;

        if(
$NewQuantity==0)
        {
            
$data->set(as_inventory);
            
$data->delete();
            
$data->where(playerid,$playerinfo['id']);
            
$data->where(item,'armor');
            
$data->where(itemid,$key);
            
$data->execute(delete);
        }else{
            
$data->set(as_inventory);
            
$data->update(quantity,$NewQuantity);
            
$data->where(playerid,$playerinfo['id']);
            
$data->where(item,'armor');
            
$data->where(itemid,$key);
            
$data->execute(update);
        }
    }
    
//end complete order
    
$att->redirect("$att_filename.php?do=armory");
    
//end sell
}
//****
//End Process Selling Items
//**** 

to fix the turns thing where people use characters like /.!#$$@ just find this line in viewplayer.php

PHP Code:

if($att->clean['turns']>15 OR $att->clean['turns']>$playerinfo['turns'] OR $att->clean['turns']<1){
standard_error("You cannot use that many turns");


make sure it looks like that and has the <1

are there any other bugs?

NavS 04-11-2009 12:13 AM

oops just forgot add the same thing for the spies

PHP Code:

OR $att->clean['spies']<


Blackhat 04-11-2009 09:09 AM

Quote:

Originally Posted by NavS (Post 1788555)
for the being able to sell .5 of something change the selling items section of armory.php. This isn't really a solution but it fixes the problem, users won't be able to sell one of something only 2+

PHP Code:

//****
//Process Selling Items
//****
$att->clean(p,'posted2',str);
if(
$att->clean['posted2']=='yes')
{
    
//begin sell

    
$SellWeaponArray=array();
    
$SellArmorArray=array();

    foreach(
$InventoryWeaponArray as $value)
    {
        
$att->clean(p,"sellweapon$value[id]",uint);
        if(
$att->clean["sellweapon$value[id]"]>$value['quantity'] OR $value['quantity']<2)
        {
            
standard_error("You do not have that many items to sell");
        }
        if(
$att->clean["sellweapon$value[id]"]>0)
        {
            
$SellWeaponArray[$value['itemid']]=$att->clean["sellweapon$value[id]"];
        }
    }

    foreach(
$InventoryArmorArray as $value)
    {
        
$att->clean(p,"sellarmor$value[id]",uint);
        
        if(
$att->clean["sellarmor$value[id]"]>0)
        {
            
$SellArmorArray[$value['itemid']]=$att->clean["sellarmor$value[id]"];
        }
        if(
$att->clean["sellarmor$value[id]"]>$value['quantity'] OR $value['quantity']<2)
        {
            
standard_error("You do not have that many items to sell");
        }
    }

    
//calculate total reimbursement
    
$TotalSellValue=0;
    foreach(
$SellWeaponArray as $key=>$value)
    {
        
$SellValue=0;
        
$SellValue=round($WeaponList[$key]['cost']-$WeaponList[$key]['cost']*$WeaponList[$key]['sellpenalty']/100);
        if(
$SellValue<0)
        {
            
$SellValue=0;
        }
            
$TotalSellValue=$TotalSellValue+$SellValue*$value;
    }
    foreach(
$SellArmorArray as $key=>$value)
    {
        
$SellValue=0;
        
$SellValue=round($ArmorList[$key]['cost']-$ArmorList[$key]['cost']*$ArmorList[$key]['sellpenalty']/100);
        if(
$SellValue<0){
            
$SellValue=0;
        }
        
$TotalSellValue=$TotalSellValue+$SellValue*$value;
    }

    
//give money
    
$NewGoldAmount=$playerinfo['gold']+$TotalSellValue;
    
$data->set(as_user);
    
$data->update(gold,$NewGoldAmount);
    
$data->where(id,$playerinfo['id']);
    
$data->execute(update);
    
//end give money
    //complete order.
    
foreach($SellWeaponArray as $key=>$value)
    {
        
$data->set(as_inventory);
        
$data->select('*');
        
$data->where(playerid,$playerinfo['id']);
        
$data->where(item,'weapon');
        
$data->where(itemid,$key);
        
$SellInfo=$data->execute(select1);

        
$NewQuantity=$SellInfo['quantity']-$value;

        if(
$NewQuantity==0){
            
$data->set(as_inventory);
            
$data->delete();
            
$data->where(playerid,$playerinfo['id']);
            
$data->where(item,'weapon');
            
$data->where(itemid,$key);
            
$data->execute(delete);
        }else{
            
$data->set(as_inventory);
            
$data->update(quantity,$NewQuantity);
            
$data->where(playerid,$playerinfo['id']);
            
$data->where(item,'weapon');
            
$data->where(itemid,$key);
            
$data->execute(update);
        }
    }
    foreach(
$SellArmorArray as $key=>$value)
    {

        
$data->set(as_inventory);
        
$data->select('*');
        
$data->where(playerid,$playerinfo['id']);
        
$data->where(item,'armor');
        
$data->where(itemid,$key);
        
$SellInfo=$data->execute(select1);

        
$NewQuantity=$SellInfo['quantity']-$value;

        if(
$NewQuantity==0)
        {
            
$data->set(as_inventory);
            
$data->delete();
            
$data->where(playerid,$playerinfo['id']);
            
$data->where(item,'armor');
            
$data->where(itemid,$key);
            
$data->execute(delete);
        }else{
            
$data->set(as_inventory);
            
$data->update(quantity,$NewQuantity);
            
$data->where(playerid,$playerinfo['id']);
            
$data->where(item,'armor');
            
$data->where(itemid,$key);
            
$data->execute(update);
        }
    }
    
//end complete order
    
$att->redirect("$att_filename.php?do=armory");
    
//end sell
}
//****
//End Process Selling Items
//**** 

to fix the turns thing where people use characters like /.!#$$@ just find this line in viewplayer.php

PHP Code:

if($att->clean['turns']>15 OR $att->clean['turns']>$playerinfo['turns'] OR $att->clean['turns']<1){
standard_error("You cannot use that many turns");


make sure it looks like that and has the <1

are there any other bugs?

I can still sell for .5 even after I changed to this new code

NavS 04-11-2009 08:01 PM

Quote:

Originally Posted by Blackhat (Post 1788770)
I can still sell for .5 even after I changed to this new code

hmn... post your code... I can't even sell one only 2+


All times are GMT. The time now is 07:57 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01449 seconds
  • Memory Usage 1,887KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (9)bbcode_php_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete