View Single Post
Xvil
BANNED
Join Date: Feb 2012
Old 03-13-2012 , 15:24   Re: [HOWTO] Spawn Sprites
Reply With Quote #6

Quote:
Originally Posted by striker07 View Post
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_MessageBeginMSG_PVSSVC_TEMPENTITYOrigin); 
  
  
engfuncEngFunc_WriteCoordOrigin ); 
 
  
write_shortlightningsprite );  
  
write_byte); //sprite wil show only 1sec?
  //write_byte( 30 ); is this the damage that will be dealth?
  
write_byte10 ); //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() 


Last edited by Xvil; 03-14-2012 at 13:48.
Xvil is offline