![]() |
Scrolling?
I am working on a bank menu and it uses showimg (Shrimp helped me make it nice). Im wondering how to use showimg so that u can hold left or right and scroll between 0 and playerrupees. So like it would show:
How much to Deposit: >0 Done And you hold left or right and it adds 1. Im trying to think of how to do this and then for Withdrawl How much to Withdrawl: >0 Done and it scrolls between max money they have deposited and 0 |
// NPC made by Stalin
if (playerenters) { message Deposit; setstring playerdeposit,0; } if (playertouchsme) { disabledefmovement; setani idle,; showimg 510,@Arial@b@ENTER THE AMOUNT TO DEPOSIT,(screenwidth/2)-80,(screenheight/2-120); showimg 511,@Arial@>#v(#s(playerdeposit)),(screenwidth/2)-80,(screenheight/2-100); showimg 512,@Arial@Done,(screenwidth/2)-80,(screenheight/2-80); changeimgvis 510,4; changeimgvis 511,4; changeimgvis 512,4; timeout=.05; } if(timeout){ if(keydown(3)&&strtofloat(#s(playerdeposit))<playe rrupees){ setstring playerdeposit,#v(strtofloat(#s(playerdeposit))+1); showimg 511,@Arial@b@>#v(#s(playerdeposit)),(screenwidth/2)-80,(screenheight/2-100); timeout=.05; } if(keydown(2)){ showimg 511,@Arial@b@#v(#s(playerdeposit)),(screenwidth/2)-80,(screenheight/2-100); showimg 512,@Arial@b@>Done,(screenwidth/2)-80,(screenheight/2-80); timeout=.05; } timeout=.05; } I tried but it no worked =( |
Here is what I noticed,
- left is keydown(1) - the first showimgs dont have all the bicus in them - you only need to set the timeout once, at the end before you end the if - showimgs in timeout, see above - change NPC Code:showimg 511,@Arial@b@>#v(#s(playerdeposit)),(screenwidth/2)-80,(screenheight/2-100); into NPC Code:showimg 511,@Arial@b@>#v(strtofloat(#s(playerdeposit))),(screenwidth/2)-80,(screenheight/2-100); Other than that I don't see anything wrong |
-=Josey=-
I know this isn't scripting related, but, Lomgren where in Missouri do you live? |
for some reason if I hit a key it disappears
|
I think my graal is messed up, alot of scripts aren't working when they should... I live in Jefferson Count, hyuh
|
Lomgren
Senior Member, Anti-Spam how did u get that? |
Quote:
edit: *i think* |
Index it, then save it. Then just use the key functions to go back and forth between 1 and variablehere. When it reaches the end and the player presses the forward button again, just rewind all the way back to 1 yo.
|
he joined in March, when you could set status without having 1000 posts
|
*Note* read the first part of my sig, I am not really Lomgren...
|
This works:
// NPC made by Stalin if (playerenters) { message Deposit; } if (playertouchsme) { playerdeposit=0; disabledefmovement; showimg 510,@Arial@b@ENTER THE AMOUNT TO DEPOSIT,(screenwidth/2)-80,(screenheight/2-120); showimg 511,@Arial@>#v(playerdeposit),(screenwidth/2)-80,(screenheight/2-100); showimg 512,@Arial@Done,(screenwidth/2)-80,(screenheight/2-80); this.mode=1; this.mode4=0; this.mode2=1; timeout=.05; } if(timeout && this.mode==1 && this.mode4==0){ setani idle,; if(this.mode2==1){ showimg 511,@Arial@>#v(playerdeposit),(screenwidth/2)-80,(screenheight/2-100); }else{ showimg 511,@Arial@#v(playerdeposit),(screenwidth/2)-80,(screenheight/2-100); } if(this.mode2==2){ showimg 512,@Arial@>Done,(screenwidth/2)-80,(screenheight/2-80); }else{ showimg 512,@Arial@Done,(screenwidth/2)-80,(screenheight/2-80); } changeimgvis 510,4; changeimgvis 511,4; changeimgvis 512,4; if(keydown(0)){ this.mode2=1; this.mode3=1; timeout=.05; } if(keydown(2)){ this.mode2=2; this.mode3=0; timeout=.05; } if(keydown(3) && playerdeposit<playerrupees && this.mode3==1){ playerdeposit+=1; timeout=.05; } if(keydown(1) && playerdeposit>0 && this.mode3==1){ playerdeposit-=1; timeout=.05; } if (keydown(4) && this.mode2==2) { enabledefmovement; hideimg 510; hideimg 511; hideimg 512; this.mode4=1; } timeout=.05; } |
I wasnt really looking to have it all made for me but thanks man. No one else would help and you did =D
|
No problem. I was bored cause i cant connect to graal.
|
All times are GMT +2. The time now is 02:10 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.