vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   RPG Integration Hack (https://vborg.vbsupport.ru/forumdisplay.php?f=102)
-   -   Just installed the hack.. but error... (https://vborg.vbsupport.ru/showthread.php?t=82983)

PING1434a 06-12-2005 09:14 PM

Just installed the hack.. but error...
 
Hello, I just installed this RPG Hack into a fresh installation of VB 3.0.7
I tried it out to see what it was like, but after making a post i got an error:

at the very top of the page, i get:

Warning: Invalid argument(s) passed to pow() in /includes/functions_rpg.php on line 591

Warning: Invalid argument(s) passed to pow() in /includes/functions_rpg.php on line 591


than i get this message:
vBulletin Message
Unable to add cookies, header already sent.
File: N/A
Line: 0


it seems like there's a problem with:

$level = pow(log10($experience), $exprate);

in

function fetch_rpg_level($experience, $exprate = 3, $returnfloat = 0)
{
if ($returnfloat)
{
if ($experience > 0)
{
$level = pow(log10($experience), $exprate);
return $level;
}
else
{
return 1;
}
}
else
{
if ($experience > 0)
{
$level = floor(pow(log10($experience), $exprate)) + 1;
return $level;
}
else
{
return 1;
}
}
}


Can anyone point me to the right direction?

FIXED! it's my PHP version that was causing it... that's what it seems like, I added (float) in front of the variable and got a work around. My php version is 4.2.2

Revan 06-13-2005 05:22 AM

Makes no sense that the "returnfloat" shouldn't make it return float :P
Ill fix it for the next version, thanks for letting me know :)

PING1434a 06-16-2005 03:43 AM

yeah! basically, this is what i did:

$level = pow(log10((float)$experience), (float)$exprate);

instead of :

$level = pow(log10($experience), $exprate);

i'm guessing it's just problem with older version of php since no one else seems to be having problem with it -.-;

Thanks for the GREAT hack by the way!

Revan 06-16-2005 07:54 AM

What I did was put floatval() around the entire line, like so:
$level = floatval(pow(log10($experience), $exprate));
Guess it has the same effect ;)
And yeah, I would have to go with old PHP version too. But it's always nice to be backwards compatible ;)

Im glad you enjoy the hack, and I'll be looking forward to having you with us even onto vB 3.5 and the new heights the hack will reach :)


//peace


All times are GMT. The time now is 06:06 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.02610 seconds
  • Memory Usage 1,714KB
  • 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
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (4)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete