Hello everybody!
I try to show a sprite (C4MARK) at the top of head of player who hold the C4.
On Rounstart Event I check player has C4 and call the function
PHP Code:
public ShowC4Icon(id)
{
// Create entity at player's position
new Entity = engfunc( EngFunc_CreateNamedEntity, engfunc( EngFunc_AllocString, "env_sprite"))
new Float:HeadOrigin[3], Float:HeadAngles[3];
engfunc(EngFunc_GetBonePosition, id, 8,HeadOrigin,HeadAngles);
// Set sprite on entity
engfunc( EngFunc_SetModel, Entity,C4Sprite)
set_pev(Entity, pev_scale, 0.5);
//set origin
HeadOrigin[2]+=25.0
set_pev(Entity, pev_origin, HeadOrigin)
set_pev(Entity, pev_movetype, MOVETYPE_FOLLOW)
set_pev(Entity, pev_aiment, id);
// Set proper rendering
set_pev(Entity, pev_rendermode, kRenderTransAdd)
set_pev(Entity, pev_renderamt, 200.0)
dllfunc( DLLFunc_Spawn,Entity)
}
It worked but I have some problem
1. How do i make the sprite entity can be seen through the wall . I mean that i can not see the player hold c4 but i still see the c4sprite through wall
2. How do I make that only Terror can see the c4sprite
Anybody have any idea? Great thanks!