Raised This Month: $ Target: $400
 0% 

Explode an entity


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Randomize
BANNED
Join Date: May 2012
Location: in your heart
Old 08-08-2013 , 11:15   Re: Explode an entity
Reply With Quote #3

Yes I want to slap/kill them. What I've done is like this:
PHP Code:
public explode_bomb(id)
{
    if(!
is_valid_ent(c5_entity))
    {
        
client_print(print_chat "* Invalid ENTITY: %i" c5_entity);
    }
    new 
ent_c5 entity_get_int(c5_entityEV_ENT_owner)
    
    new 
Float:fOrigin[3]
    new 
iOrigin[3]
    
    new 
g_players[32], g_playersnumx
    get_players
(g_playersg_playersnum"a")
    
    
entity_get_vector(c5_entityEV_VEC_originfOrigin)
    
FVecIVec(fOriginiOrigin)
    
    for(
0<= g_playersnumx++)
    {
        new 
g_players[x]

        new 
g_distance floatround(entity_range(c5_entityi))

        if (
g_distance <= 300)
        {
            if(
get_user_team(id) != get_user_team(i))
            {
                
user_silentkill(i)
                
make_deathmsg(idi0"grenade")
                
set_user_frags(idget_user_frags(id) + 1)
                
emit_sound(idCHAN_AUTOg_c5_hit[random_num(02)], 1.0ATTN_NORM0PITCH_NORM)
                
cs_set_user_money(idcs_get_user_money(id) + 300)
            }
            else
            {
                if(
get_user_team(id) != get_user_team(i))
                {
                    
set_user_health(iget_user_health(i) - 100)
                    
emit_sound(idCHAN_AUTOg_c5_hit[random_num(02)], 1.0ATTN_NORM0PITCH_NORM)
                }
            }
        }
    }
    
    
message_begin(MSG_BROADCASTSVC_TEMPENTITYiOrigin)
    
write_byte (TE_EXPLOSION)
    
write_coord(iOrigin[0])
    
write_coord(iOrigin[1])
    
write_coord(iOrigin[2])
    
write_short(explode)
    
write_byte (30)
    
write_byte (15)
    
write_byte (0)
    
message_end()

    
message_begin(MSG_BROADCASTSVC_TEMPENTITYiOrigin)
    
write_byte (TE_SMOKE)
    
write_coord(iOrigin[0])
    
write_coord(iOrigin[1])
    
write_coord(iOrigin[2])
    
write_short(smoke)
    
write_byte (100)
    
write_byte (15)
    
message_end()
    
    
engclient_cmd(id"lastinv")
    
cs_set_user_bpammo(idCSW_HEGRENADE0)
    
remove_entity(c5_entity)
    
    
g_has_dectonator[id] = false
    g_has_planted
[id] = false
    g_bought
[id] = false

Randomize 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 15:45.


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