Create a static shell for a bullet, without animations.
You can create more than one shell using
ent_createlayer(STRING* filename, var flags2, var layer)
Look for the function in the manual.
After creating the shell, give it a layer and position on the screen and animate it through script.
Add initial velocity upwards and right (for example) and then decrease the upwards velocity until a gravity effect is simulated.
If you want you can use world entities (ent_create) but then you have to make then spawn exactly at a specific point on the screen (possibly converting screen cordinates X,Y to world coordinates with a Z distance value).
This has the advantage that the shells can be left on the ground for the player to look at for a few seconds before fading away.
I hope this helps you.
PS.: vec_for_screen (convert screen coordinatess to world coordinatess) example
This isnt tested, but it should work. Write your own code for the animation after the comment line using c_move and a decreasing skill for z velocity...
function animate_shell()
{
my.skill10 = 250; //lifespan
while(my.skill10 > 0)
{
// animate it here
// ...
my.skill10 -= 1;
wait(1);
}
}
// In player action (if a mouse_left input)
shell_spawn.x = 640; // Middle of resolution 1280x1024
shell_spawn.y = 512;
shell_spawn.z = 10; // Distance from screen
vec_for_screen(shell_spawn.x,camera);
ent_create("shell.mdl",shell_spawn.x,animate_shell);