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
0 registered members (), 18,767 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
Need some help with my code #255835
03/12/09 22:14
03/12/09 22:14
Joined: Dec 2008
Posts: 56
B
binsky33333 Offline OP
Junior Member
binsky33333  Offline OP
Junior Member
B

Joined: Dec 2008
Posts: 56
Here is the function i have. Basically this function animates a gun when the left mouse button is clicked. Btw this code is in a different .wdl file.
Code:
var gun_percent = 0;
function run_weapons()
{
	wait(1);
	while(player!=NULL)
	{
		while(mouse_left)
		{
			while(int(gun_percent)<98)
			{
				ent_animate(gun0,"shoot",gun_percent,ANM_CYCLE);
				gun_percent=(gun_percent+10*time)%100;
				
				wait(1);
			}
			gun_percent=0;
			wait(1);
		}
		wait(1);
	}
}
 

Now i want to use this function for my player, so in the p1biped action on the first line of it i add, run_weapon();
But then when i run the game, i click and the animation doesnt happen, nor does a sound i have added which is supposed to play(its not in the code up there). What wrong? Any suggestions?

Thanks!

Re: Need some help with my code [Re: binsky33333] #255838
03/12/09 23:15
03/12/09 23:15
Joined: Apr 2006
Posts: 737
Ottawa, Canada
O
Ottawa Offline
User
Ottawa  Offline
User
O

Joined: Apr 2006
Posts: 737
Ottawa, Canada
Hi!

time in
gun_percent=(gun_percent+10*time)%100;


should be time_step // in Lite-C

Ottawa smile


Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

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