Author
|
Message
|
BANNED
|
03-10-2012
, 12:07
[HOWTO] Spawn Sprites
|
#1
|
You Can Use this Script To Display Sprites
Get Player Origin:
PHP Code:
new Float:start[ 3 ]
// get user Origin
entity_get_vector( id, EV_VEC_origin, start );
Display Sprite:
PHP Code:
message_begin(MSG_PVS, SVC_TEMPENTITY, origin)
write_byte(TE_SPRITETRAIL)
write_coord(start[0]) // x
write_coord(start[1]) // y
write_coord(start[2] ) // z
write_coord(end[0]) // x Example end[0] = start[0] + 100
write_coord(end[1]) // y Example end[1] = start[1]
write_coord(end[2]) // z Example end[2] = start[2]
write_short(g_sprite) // Sprite Index
write_byte(25) // Count
write_byte(25) // Life
write_byte(2) // Scale
write_byte(50) // Velocity Along Vector
write_byte(10) // Rendomness of Velocity
message_end();
Example:
Spoiler
PHP Code:
// includes
#include <amxmodx>
#include <engine>
#include <fakemeta>
// Sprite index
new SPR_FIRE;
public plugin_precache()
{
// Precache Sprite
SPR_FIRE = precache_model( "sprites/flame.spr" );
}
public plugin_init()
{
// Command To Display Sprite
register_clcmd("+fire", "ShowSpr");
}
public ShowSpr(id)
{
new Float:Origin[ 3 ]
// get user Origin
entity_get_vector( id, EV_VEC_origin, Origin );
engfunc( EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, Origin, 0);
write_byte( TE_SPRITETRAIL );
engfunc( EngFunc_WriteCoord, Origin[ 0 ] );
engfunc( EngFunc_WriteCoord, Origin[ 1 ] );
engfunc( EngFunc_WriteCoord, Origin[ 2 ] );
engfunc( EngFunc_WriteCoord, Origin[ 0 ] );
engfunc( EngFunc_WriteCoord, Origin[ 1 ] );
engfunc( EngFunc_WriteCoord, Origin[ 2 ] + 30 );
write_short( SPR_FIRE );
write_byte( 3 );
write_byte( 30 );
write_byte( 10 );
write_byte( 45 );
write_byte( 40 );
message_end( );
}
Screenshot:
Last edited by Xvil; 03-12-2012 at 02:59.
|
|
|
|