Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
4 registered members (dBc, clonman, TipmyPip, 1 invisible), 18,936 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
HOW TO STOP KEY #324044
05/19/10 09:15
05/19/10 09:15
Joined: Apr 2010
Posts: 43
C
cgcg Offline OP
Newbie
cgcg  Offline OP
Newbie
C

Joined: Apr 2010
Posts: 43
var car_car=0;
if (car_car==1)
{
key_z=off;
key_a=off;
key_d=off;
key_s=off;
}
but this code not work

Re: HOW TO STOP KEY [Re: cgcg] #324045
05/19/10 09:19
05/19/10 09:19
Joined: Nov 2008
Posts: 196
the wrong place
Muhsin Offline
Member
Muhsin  Offline
Member

Joined: Nov 2008
Posts: 196
the wrong place
where do you use those keys. can you show it?


Come and play my new browsergame - Valley Of Wolves:

http://www.mafiacreator.com/ValleyOfWolves

Hurry and be the first to take over the different business' in the Valley Of Wolves, before anybody else does it!
And be the most feared MafiaBoss in the World!!
Re: HOW TO STOP KEY [Re: Muhsin] #324047
05/19/10 09:44
05/19/10 09:44
Joined: Nov 2008
Posts: 196
the wrong place
Muhsin Offline
Member
Muhsin  Offline
Member

Joined: Nov 2008
Posts: 196
the wrong place
you could do like this:
-----------------------------------------
var car_car = 0;

if(car_car == 0)
{

if(key_z)
{
//you code, when you click z
}
if(key_a)
{
//you code, when you click a
}
if(key_d)
{
//you code, when you click d
}
if(key_s)
{
//you code, when you click s
}

}
-----------------------------------

- Muhsin Kaymak


Come and play my new browsergame - Valley Of Wolves:

http://www.mafiacreator.com/ValleyOfWolves

Hurry and be the first to take over the different business' in the Valley Of Wolves, before anybody else does it!
And be the most feared MafiaBoss in the World!!
Re: HOW TO STOP KEY [Re: Muhsin] #324048
05/19/10 10:02
05/19/10 10:02
Joined: Apr 2010
Posts: 43
C
cgcg Offline OP
Newbie
cgcg  Offline OP
Newbie
C

Joined: Apr 2010
Posts: 43
var car_car = 0;

if(car_car == 1)
{

if(key_z==off)
{
//you code, when you click z
}
if(key_a==off)
{
//you code, when you click a
}
if(key_d==off)
{
//you code, when you click d
}
if(key_s==off)
{
//you code, when you click s
}
THE CODE NOT WORK

Re: HOW TO STOP KEY [Re: cgcg] #324050
05/19/10 10:21
05/19/10 10:21
Joined: Jul 2008
Posts: 1,178
England
M
MrGuest Offline
Serious User
MrGuest  Offline
Serious User
M

Joined: Jul 2008
Posts: 1,178
England
if that function is running in a while loop, you'd be better off terminating the function that's using if(key_w) etc...
have a look in the manual at proc_kill(void)

posting
Originally Posted By: cgcg
THE CODE NOT WORK
when someone has asked
Originally Posted By: Mushin
where do you use those keys. can you show it?
isn't really useful wink

Re: HOW TO STOP KEY [Re: cgcg] #324051
05/19/10 10:22
05/19/10 10:22
Joined: May 2010
Posts: 117
Germany , Dortmund
B
Bone Offline
Member
Bone  Offline
Member
B

Joined: May 2010
Posts: 117
Germany , Dortmund

With if you can check which key the person press or which key (or keys) are not pressed

Code:
var key_s_counter = 0;

if(key_s && !key_w) // if key_s is true (key_s == 1) & key_w is false (key_w == 0)
 key_s_counter +=1;




I dont know what you want to do.
Please write more about your problem.

Re: HOW TO STOP KEY [Re: Bone] #324068
05/19/10 12:52
05/19/10 12:52
Joined: Apr 2010
Posts: 43
C
cgcg Offline OP
Newbie
cgcg  Offline OP
Newbie
C

Joined: Apr 2010
Posts: 43
i am create GTA GAME But the car is moving on after

Re: HOW TO STOP KEY [Re: Bone] #324069
05/19/10 12:54
05/19/10 12:54
Joined: Apr 2005
Posts: 1,988
Canadian, Eh
DLively Offline
Serious User
DLively  Offline
Serious User

Joined: Apr 2005
Posts: 1,988
Canadian, Eh
basically;

reverse your code.

instead of this

Code:
if (car_car==1)
{
key_z=off;
key_a=off;
key_d=off;
key_s=off;
}



cause with this , the engine can't terminate the keys that simply.
you need to tell the engine that while car_car is 0, the keys are function-able.

Code:
//if its not 0, the engine will pass it, and fly right through to next if / code
if (car_car==0)//while the variable is 0, you can set up these keys to work
{

if(key_z)
{
//you code, when you click z
}

if(key_a)
{
//you code, when you click a
}

if(key_d)
{
//you code, when you click d
}

if(key_s)
{
//you code, when you click s
}

}



Muhsin answered your question a long time ago - just not very clearly.


A8 Pro 8.45.4
YouTube: Create Games For Free
Free Resources: www.CGForFree.com
Re: HOW TO STOP KEY [Re: DLively] #324072
05/19/10 13:11
05/19/10 13:11
Joined: Apr 2010
Posts: 43
C
cgcg Offline OP
Newbie
cgcg  Offline OP
Newbie
C

Joined: Apr 2010
Posts: 43
if(key_z)
{
//What do I write here to stop the button works????????
}

if(key_a)
{
//What do I write here to stop the button works???????
}

if(key_d)
{
//What do I write here to stop the button works???????????
}

if(key_s)
{
//What do I write here to stop the button works?????????
}

}

Re: HOW TO STOP KEY [Re: cgcg] #324075
05/19/10 13:15
05/19/10 13:15
Joined: Jan 2002
Posts: 4,225
Germany / Essen
Uhrwerk Offline
Expert
Uhrwerk  Offline
Expert

Joined: Jan 2002
Posts: 4,225
Germany / Essen
YOU CANT STOP THE BUTTON WORKS. READ A TUTORIAL. SERIOUSLY.


Always learn from history, to be sure you make the same mistakes again...
Page 1 of 2 1 2

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1