Thread: keypressed
View Single Post
  #4  
Old 04-04-2002, 11:14 AM
amonrabr amonrabr is offline
Scripter
Join Date: Nov 2001
Location: Brazil
Posts: 374
amonrabr is on a distinguished road
Angry

¬¬'' ..no comments...


Keypressed you have to RELEASE the key!!!

try this script and u will understand..
timeout=.05;
if (keydown(5)&&this.mode==0){this.mode=1}
if (keydown(5)&&this.mode==1){this.mode=0}
if (this.mode==1){setplayerprop #c,1;}else setplayerprop #c,2;

I wanna press S and say 1.. if I press S again say 2.. but the timeout is too fast and will be showing {1,2,1,2,1,2,1,2,1... very fast}..
There is an easy way to do release keys..

setarray this.key,10;
setarray this.oldkey,10;
for (i=0;i<10;i++)
{this.key[i]=this.oldkey[i];
this.oldkey[i]=keydown(i);}

¬¬'' Did u get now???
Did u see somewhere menus where you press D to open, S to the first choise and A to the second choise? the guy that made it didnt know the script that I said..
Reply With Quote