Gamestudio Links
Zorro Links
Newest Posts
Executing Trades on Next Bar Open
by vicknick. 06/13/24 08:51
Zorro Beta 2.61: PyTorch
by jcl. 06/10/24 14:42
New FXCM FIX Plugin
by flink. 06/04/24 07:30
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (AndrewAMD, 1 invisible), 1,211 guests, and 7 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19059 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 | chip programmers | 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