Raised This Month: $ Target: $400
 0% 

C4 mark through wall


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
snack_koo
Junior Member
Join Date: Jan 2012
Old 07-10-2013 , 10:09   C4 mark through wall
Reply With Quote #1

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 engfuncEngFunc_CreateNamedEntityengfuncEngFunc_AllocString"env_sprite"))    
    new 
Float:HeadOrigin[3], Float:HeadAngles[3];
    
engfunc(EngFunc_GetBonePositionid8,HeadOrigin,HeadAngles);    
    
// Set sprite on entity    
    
engfuncEngFunc_SetModelEntity,C4Sprite)
    
set_pev(Entitypev_scale0.5);
    
//set origin
    
HeadOrigin[2]+=25.0
    set_pev
(Entitypev_originHeadOrigin)    

    
set_pev(Entitypev_movetypeMOVETYPE_FOLLOW
    
set_pev(Entitypev_aimentid);
    
    
// Set proper rendering
    
set_pev(Entitypev_rendermodekRenderTransAdd)
    
set_pev(Entitypev_renderamt200.0)
    
    
dllfuncDLLFunc_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!
snack_koo is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 06:28.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode