32 to 3 and 2?
#1
Posted 02 November 2005 - 03:39 PM
Problem comes when the numbers reach double figures. I'm not going to make 9999 images, one for each ammout of damage that can be done. Instead i just want to make 0-9 then then put them next to each other, so that i have my 1.gif next to 3.gif to make it look like 13.
What do i put in php to make this happen?
#2
Posted 02 November 2005 - 03:56 PM
For longer numbers, one way off the top of my head would be
<?php $value = 135125; // $value is your number $value = (string)$value; for ($i = 0; $i < strlen($value); $i++) print $value[$i] . '<br />'; ?>
What's stopping you from migrating to Ares? We can't implement it unless you tell us!
ModEnc - C&C Modding Encyclopedia | Modders' Quote Database | Yet Another C&C Modding Forum
#3 Guest_ImmoMan_*
Posted 02 November 2005 - 05:16 PM
$value{$i}
See here for more info:
http://www.php.net/types.string
Edited by ImmoMan, 02 November 2005 - 05:18 PM.
#4
Posted 02 November 2005 - 05:25 PM
<?php
$value = 135125;
$value = (string)$value;
echo ("<img src=".$value{0}.".gif>");
echo ("<img src=".$value{1}.".gif>");
echo ("<img src=".$value{2}.".gif>");
echo ("<img src=".$value{3}.".gif>");
echo ("<img src=".$value{4}.".gif>");
?>
Now i have everything i need to make my interface look like FF
Immo, Both [ and { work.
#5
Posted 02 November 2005 - 05:26 PM
What's stopping you from migrating to Ares? We can't implement it unless you tell us!
ModEnc - C&C Modding Encyclopedia | Modders' Quote Database | Yet Another C&C Modding Forum
#6 Guest_ImmoMan_*
Posted 02 November 2005 - 06:08 PM
#7
Posted 02 November 2005 - 06:12 PM
What's stopping you from migrating to Ares? We can't implement it unless you tell us!
ModEnc - C&C Modding Encyclopedia | Modders' Quote Database | Yet Another C&C Modding Forum
#8
Posted 02 November 2005 - 06:26 PM
I'd use gd library.DCoder, Thanks
<?php
$value = 135125;
$value = (string)$value;
echo ("<img src=".$value{0}.".gif>");
echo ("<img src=".$value{1}.".gif>");
echo ("<img src=".$value{2}.".gif>");
echo ("<img src=".$value{3}.".gif>");
echo ("<img src=".$value{4}.".gif>");
?>
Now i have everything i need to make my interface look like FF
Immo, Both [ and { work.
http://www.php.net/gd
Edited by Blodo, 02 November 2005 - 06:28 PM.
ARGUMENT FROM CREATION, a.k.a. ARGUMENT FROM PERSONAL INCREDULITY (I)
(1) If evolution is false, then creationism is true, and therefore God exists.
(2) Evolution can't be true, since I lack the mental capacity to understand it; moreover, to accept its truth would cause me to be uncomfortable.
(3) Therefore, God exists.
#9 Guest_ImmoMan_*
Posted 02 November 2005 - 06:28 PM
#10
Posted 02 November 2005 - 06:30 PM
ARGUMENT FROM CREATION, a.k.a. ARGUMENT FROM PERSONAL INCREDULITY (I)
(1) If evolution is false, then creationism is true, and therefore God exists.
(2) Evolution can't be true, since I lack the mental capacity to understand it; moreover, to accept its truth would cause me to be uncomfortable.
(3) Therefore, God exists.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users