ID:141745
 
Code:
turf
numbers
zero
icon='0.bmp'
one
icon='1.bmp'
two
icon='2.bmp'
three
icon='3.bmp'
four
icon='4.bmp'
five
icon='5.bmp'
six
icon='6.bmp'
seven
icon='7.bmp'
eight
icon='8.bmp'
nine
icon='9.bmp'


mob
proc
checksp()
var/a=usr.sp
if(a<10)
if(a==0)
var/turf/numbers/zero/b = new /turf/numbers/zero
b.loc=locate(0,0,0,)
if(a==1)
var/turf/numbers/one/b = new /turf/numbers/one
b.loc=locate(0,0,0,)
if(a==2)
var/turf/numbers/two/b = new /turf/numbers/two
b.loc=locate(0,0,0,)
if(a==3)
var/turf/numbers/three/b = new /turf/numbers/three
b.loc=locate(0,0,0,)
if(a==4)
var/turf/numbers/four/b = new /turf/numbers/four
b.loc=locate(0,0,0,)
if(a==5)
var/turf/numbers/five/b = new /turf/numbers/five
b.loc=locate(0,0,0,)
if(a==6)
var/turf/numbers/six/b = new /turf/numbers/six
b.loc=locate(0,0,0,)
if(a==7)
var/turf/numbers/seven/b = new /turf/numbers/seven
b.loc=locate(0,0,0,)
if(a==8)
var/turf/numbers/eight/b = new /turf/numbers/eight
b.loc=locate(0,0,0,)
if(a==9)
var/turf/numbers/nine/b = new /turf/numbers/nine
b.loc=locate(0,0,0,)
////etc etc but tht wil take ages/////


Problem description:

There has to be an easier way to do this.
turf/number

mob/proc/checksp()
//Don't use usr in proc.
if(sp < 10)
var/turf/number/n = new(locate(0, 0, 0))
n.icon = file("[sp].bmp")
In response to Popisfizzy
oh ty so much
In response to Rapmaster
turf/number

mob/proc/checksp()
var/turf/number/n = new(locate(0, 0, 0))
n.icon = file("[sp].bmp")//make icons for up to 9999 ??


do i have to make all those icon files for example if the person has 3500 sp