Try something like this instead
` Initialisation near the top of your code somewhere
AnimPlayed=0
AnimPlaying=0
` This in your game loop to see if the animation should be started,
` and if already played, to delete it
if AnimPlayed = 0
if AnimPlaying = 0
disX# = Abs(Box_X# - PlayerX#)
disZ# = Abs(Box_Z# - PlayerZ#)
if disX# <200 and disZ# <200
AnimPlaying = 1
play animation 1
endif
else
if animation playing(1) = 0
AnimPlayed = 1
AnimPlaying = 0
delete animation 1
endif
endif
endif
*** Coming soon - Network Plug-in - Check my site for info ***
For free Plug-ins, source and the Interface library for Visual C++ 6, .NET and now for Dev-C++
http://www.matrix1.demon.co.uk