Quote:
Originally Posted by striker07
how can i do it for when a player dies(origin never changes)
I want to do a lightning sprite and a exploding sprite to show up when a player dies,
wil it be effective if i do it like this:
PHP Code:
new Origin
engfunc( EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, Origin); engfunc( EngFunc_WriteCoord, Origin ); write_short( lightningsprite ); write_byte( 1 ); //sprite wil show only 1sec? //write_byte( 30 ); is this the damage that will be dealth? write_byte( 10 ); //height of the sprite? //write_byte( 45 ); no need for this becous the player isnt gonna move? //write_byte( 40 ); no need for this becous the player isnt gonna move? message_end( );
this is probably totally wrong, pls dont flame me i never worked with sprites before
|
this An Example:
PHP Code:
#include <amxmodx>
#include <engine>
#include <fakemeta>
#include <cstrike>
new g_Sprite
public plugin_precache()
{
g_Sprite = precache_model("sprites/test.spr")
}
public plugin_init()
{
register_event("DeathMsg","onDeath","a")
}
public onDeath()
{
new victim = read_data(2)
new origin[3]
get_user_origin(victim,origin)
ShowSprite(origin)
}
stock ShowSprite(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])
write_coord(origin[1])
write_coord(origin[2]+=30)
write_short(g_Sprite) // Sprite index
write_byte(8)
write_byte(255)
message_end()
}