View Single Post
  #1  
Old 07-06-2001, 07:39 AM
LiquidIce00 LiquidIce00 is offline
RadioActive Monkeeh
LiquidIce00's Avatar
Join Date: Apr 2001
Location: dirty south
Posts: 2,112
LiquidIce00 is on a distinguished road
Send a message via ICQ to LiquidIce00 Send a message via AIM to LiquidIce00 Send a message via Yahoo to LiquidIce00
Thumbs up Show Number Function

I was bored .. again
and I decided to make a little function to help some people.
I might enhance it if people like it..
it shows any number anywhere on the screen..
the only problem is that the number cant be bigger then 9999999,
else the variable becomes a long and messes up x.x
bare with me since I made this in only like 15 minutes, so it might have some bugs..
oh and I think some1 had one before this .. but I tried and it didnt work well so here is one that works well.

here is the function:
NPC Code:

function LiquidNum() {
//hide if told
if (this.hideprevious=1) {
while (this.previousindex>this.startindex) {
hideimg this.previousindex;
this.previousindex-=1;
}
}
//end hide

//do showimg of the numbers
this.count=0;
while (this.count<strlen(#v(this.number))) {
showimg this.startindex,state.png,this.x,this.y;
//get current number
this.currentnum=strtofloat(#e(this.count,1,#v(this .number)));
//end get current number
changeimgvis this.startindex,4;
changeimgpart this.startindex,this.currentnum*14,81,14,16;
//add to variables
this.startindex+=1;
this.x+=this.space;
this.count+=1;
}
//end showimg

//set highest index if needed
this.previousindex=this.startindex;
//end set highest index
}


now ill explain how to use it.
anywhere in your code you can call it , in a timeout, if player enters. whatever.
Ill explain a if playerenters one ..

NPC Code:

if (playerenters) {
//index in which we should start
this.startindex=200;
//hide previous shown imgs? 1=yes 0=no
//this is usefull if your running it in a timeout and you need it to
//clear previous showimg's so they dont show unwanteds
this.hideprevious=1;
//begin x position
this.x=250;
//y position
this.y=100;
//number to display
this.number=123456;
//space in between numbers
this.space=10;
//run function
LiquidNum();
}



Enjoy
and please tell me if you find any bugs.

oh and i might also include the chars : / so if you need to do dates or something. btw this is extracted out of state.png
__________________
LiquidIce *Owner* (UnholyNation)
-UN Website
http://www.unholynation.com
-UN Forum
http://forums.unholynation.com
-
-the thinker
-

-
onwall2 for nonp2p (i suck at onwall)

Last edited by LiquidIce00; 07-07-2001 at 07:13 AM..
Reply With Quote