nice job, and congrats, you'll be making some excellent scripts soon if this is how quick you found your own solution
just as a heads up the player distance math work isn't really needed anymore, there is a function call to get player distance:
PlayerDist = GetPlayerDistance(e)
with that you can the just check PlayerDist < whatever distance
sorry just read your script a bit more properly and you dont use the player distance math at all so that can all be removed
function shot_init(e)
SetEntityHealth(e,100)
end
function shot_main(e)
if g_Entity[e]['health'] <= 0 then
SetAnimationSpeed(e,150)
SetAnimationFrames(15,100)
PlayAnimation(e)
end
end
I also moved the set health otherwise if you do less then 100 damage everytime the script cycles i think it would reset the health to 100 again, havent tested but i think thats what would happen, and think it should mwork in the init, dont have time to test it myself but hope that helps you see how to make your code a bit cleaner
PC Specs: Windows 7 home 64-bit, Amd 7900 3gb DDR5 graphics, 8gb DDR3 Ram, Intel i7 3.4ghz