Ah nice it certainly works
but
for the lightning:
i want it to come out of the air, so that the height of the sprite dont matter becous now when players die (very low in the map) the lightning starts coming out of the air about one meter above the player heads and stops at his waste.
for the explosion:
it starts and his waste when it should start at the floor.
- for the lightning:
Can I fix this by making he sprite's height very big and keep the width or is there a way to code it so that the sprite automaticly gets streched when it spawns and starts from to top point of the map?
- for the explosion:
im gonna change the z cordinate for the sprite to write_coord(origin[2]); (without the +=30) and see what that gives
EDIT:
ok after alot of testing I now have this but i cant get it compiled becous of some errors
Spoiler
PHP Code:
#include <amxmodx>
#include <engine>
#include <fakemeta>
#include <cstrike>
new g_iSpriteLightning;
new g_iSpriteExplode;
public plugin_precache( )
{
g_iSpriteLightning = precache_model("sprites/lightning.spr");
g_iSpriteExplode = precache_model("sprites/lm_explode.spr");
}
public plugin_init()
{
register_event("DeathMsg","onDeath","a")
}
public onDeath()
{
new victim=read_data(2)
set_task(0.1,"ShowLightSpr",victim);
set_task(0.25,"ShowExplSpr",victim);
}
stock ShowLightSprite(start[3])
{
// coord coord coord (start position)
// coord coord coord (end position)
// short (sprite index)
// byte 1(starting frame)
// byte 2(frame rate in 0.1's)
// byte 3(life in 0.1's)
// byte 4(line width in 0.1's)
// byte 5(noise amplitude in 0.01's)
// byte,byte,byte 6-8(color)
// byte 9(brightness)
// byte 10(scroll speed in 0.1's)
message_begin(MSG_BROADCAST,SVC_TEMPENTITY);
write_coord(start[0]); // x
write_coord(start[1]); // y
write_coord(start[2]+=350); // z
write_coord(start[0]); // x Example end[0] = start[0] + 100
write_coord(start[1]);// y Example end[1] = start[1]
write_coord(start[2]-=15); // z
write_short(g_iSpriteLightning); // Sprite index
write_byte(1); //1
write_byte(1); //2
write_byte(30); //3
write_byte(5); //4
write_byte(10); //5
write_byte(255); //6
write_byte(140); //7
write_byte(0); //8
write_byte(255); //9
message_end();
}
public ShowLightSpr(victim)
{
new Float:start[ 3 ];
entity_get_vector( id, EV_VEC_origin, start ); //line 421
ShowLightSprite(start);
}
stock ShowExplSprite(origin[3])
{
// write_byte(TE_SPRITE)
// write_coord(position.x)
// write_coord(position.y)
// write_coord(position.z)
// write_short(sprite index)
// write_byte(scale in 0.1's)
// write_byte(brightness)
message_begin(MSG_BROADCAST,SVC_TEMPENTITY);
write_byte(TE_SPRITE);
write_coord(origin[0]); //x
write_coord(origin[1]); //y
write_coord(origin[2]-=30) ; //z
write_short(g_iSpriteExplode); // Sprite index
write_byte(6); //scale
write_byte(255); //brightness
message_end();
}
public ShowExplSpr(victim)
{
new origin[3];
get_user_origin(victim,origin);
ShowExplSprite(origin);
}
Errors:
Code:
Error: Undefined symbol "entity_get_vector" on line 421
Error: Undefined symbol "EV_VEC_origin" on line 421
Warning: Expression has no effect on line 421
Error: Expected token: ";", but found ")" on line 421
Error: Too many error messages on one line on line 421