d2jsp
Log InRegister
d2jsp Forums > d2jsp > Ladder Slasher > Guide: How-to Make A Dynamic Ladder-slasher Sig > In A Few Easy Steps With Pics
Prev1333435363760Next
Add Reply New Topic New Poll
Member
Posts: 20,664
Joined: Aug 20 2006
Gold: 620.00
May 9 2009 11:29am
$percent = calcPerToMQ($level);


/***
* Calculate the percentage to Mq
***/
function calcPerToMQ($level)

{


$temp1 = ($level/71);
$temp1 = $temp1 * 100;

return (int)$temp1;
}

since only the numbers before the comma will be shown its not this exactly but enough^^
Member
Posts: 25,450
Joined: Sep 22 2007
Gold: Locked
Trader: Scammer
May 9 2009 11:42am
Quote (erasko @ Sat, May 9 2009, 01:29pm)
$percent = calcPerToMQ($level);


/***
* Calculate the percentage to Mq
***/
function calcPerToMQ($level)

{


$temp1 = ($level/71);
$temp1 = $temp1 * 100;

        return (int)$temp1;
}

since only the numbers before the comma will be shown its not this exactly but enough^^


k got that, now how do I create a bar for it, like the exp one ? :)
Member
Posts: 20,664
Joined: Aug 20 2006
Gold: 620.00
May 9 2009 11:47am
Quote (cheeseballl @ Sat, May 9 2009, 06:42pm)
k got that, now how do I create a bar for it, like the exp one ? :)


xpbarwidth = lvl71
xxpixels = $level

/***
* calculate the exp bar width.
***/
function calcBrPixelX($xpbar_width,$level)
{
$temp1 = ($xpbar_width/71);
$temp1 = ($temp1*$level);
$temp1 = $temp1 + xxx;

return (int)$temp1;
}
Member
Posts: 30,712
Joined: Sep 19 2007
Gold: 340.00
May 9 2009 11:49am
just a tip
for your to mq % it should be (level - 1)/70
since you start at 1 :)

This post was edited by jbpellerin on May 9 2009 11:49am
Member
Posts: 25,450
Joined: Sep 22 2007
Gold: Locked
Trader: Scammer
May 9 2009 11:53am
Quote (erasko @ Sat, May 9 2009, 01:47pm)
xpbarwidth = lvl71
xxpixels = $level

/***
* calculate the exp bar width.
***/
function calcBrPixelX($xpbar_width,$level)
  {
$temp1 = ($xpbar_width/71);
$temp1 = ($temp1*$level);
$temp1 = $temp1 + xxx;

return (int)$temp1;
  }

Where do I put

xpbarwidth = lvl71
xxpixels = $level
Member
Posts: 20,664
Joined: Aug 20 2006
Gold: 620.00
May 9 2009 12:18pm
Quote (cheeseballl @ Sat, May 9 2009, 06:53pm)
Where do I put

xpbarwidth = lvl71
xxpixels = $level


nn this
was just to explain the code ;)
Member
Posts: 25,450
Joined: Sep 22 2007
Gold: Locked
Trader: Scammer
May 9 2009 12:20pm
Quote (erasko @ Sat, May 9 2009, 02:18pm)
nn this
was just to explain the code ;)


Oh.

Ok, so now when I upload it it says there's a big error ...

I currently have

Code
$percent = calcPerToMQ($level);


And

Code
/***
* calculate the exp bar width.
***/
function calcBrPixelX($xpbar_width,$level)
{
$temp1 = ($xpbar_width/71);
$temp1 = ($temp1*$level);
$temp1 = $temp1 + xxx;

return (int)$temp1;
}

/***
* Calculate the percentage to Mq
***/
function calcPerToMQ($level)

{


$temp1 = ($level/71);
$temp1 = $temp1 * 100;

return (int)$temp1;
}
Member
Posts: 20,664
Joined: Aug 20 2006
Gold: 620.00
May 9 2009 12:45pm
Quote (cheeseballl @ Sat, May 9 2009, 07:20pm)
Oh.

Ok, so now when I upload it it says there's a big error ...

I currently have

Code
$percent = calcPerToMQ($level);


And

Code
/***
* calculate the exp bar width.
***/
function calcBrPixelX($xpbar_width,$level)
{
$temp1 = ($xpbar_width/71);
$temp1 = ($temp1*$level);
$temp1 = $temp1 + xxx;

return (int)$temp1;
}

/***
* Calculate the percentage to Mq
***/
function calcPerToMQ($level)

{


$temp1 = ($level/71);
$temp1 = $temp1 * 100;

return (int)$temp1;
}


$temp1 = $temp1 + xxx;
you need to put some numbers there instead of the xxx
I just put them there since I dont know where your bar gonna start ;)
so put there the x-value of the bar beginning
Member
Posts: 25,450
Joined: Sep 22 2007
Gold: Locked
Trader: Scammer
May 9 2009 12:47pm
Well I made it 100. Still an error.
Member
Posts: 20,664
Joined: Aug 20 2006
Gold: 620.00
May 9 2009 12:59pm
Quote (cheeseballl @ Sat, May 9 2009, 07:47pm)
Well I made it 100. Still an error.


pm me your full code and I gonna check whats wrong
Go Back To Ladder Slasher Topic List
Prev1333435363760Next
Add Reply New Topic New Poll