Raised This Month: $ Target: $400
 0% 

How to change range of mines


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
CrazyChickenTest
Member
Join Date: Jul 2010
Location: World ;)
Old 07-16-2010 , 03:51   How to change range of mines
Reply With Quote #1

Hi!
I have mines on my server and I need to increase range of mines. I have that code to set mine and touch mine:
PHP Code:
public SetMine(id)
{
    if (!
Player_mines[id])
    {
        
ColorChat(id,GREEN"You have no mines to set!");
        return 
PLUGIN_CONTINUE;
    }
    
    
Player_mines[id]--;
    
    new 
Float:origin[3];
    
entity_get_vector(idEV_VEC_originorigin);
    
    new 
ent create_entity("info_target");
    
entity_set_string(ent ,EV_SZ_classname"Mine");
    
entity_set_edict(ent ,EV_ENT_ownerid);
    
entity_set_int(entEV_INT_movetypeMOVETYPE_TOSS);
    
entity_set_origin(entorigin);
    
entity_set_int(entEV_INT_solidSOLID_BBOX);
    
    
entity_set_model(ent"models/mine.mdl");
    
entity_set_size(ent,Float:{-16.0,-16.0,0.0},Float:{16.0,16.0,2.0});
    
    
drop_to_floor(ent);
    
    
entity_set_float(ent,EV_FL_nextthink,halflife_time() + 0.01) ;
    
    
    return 
PLUGIN_CONTINUE;
}

public 
MineTouch(entid)
{
    new 
attacker entity_get_edict(entEV_ENT_owner);
    if (
get_user_team(attacker) != get_user_team(id))
    {
        new 
Float:fOrigin[3], iOrigin[3];
        
entity_get_vectorentEV_VEC_originfOrigin);
        
iOrigin[0] = floatround(fOrigin[0]);
        
iOrigin[1] = floatround(fOrigin[1]);
        
iOrigin[2] = floatround(fOrigin[2]);
        
        
message_begin(MSG_BROADCAST,SVC_TEMPENTITYiOrigin);
        
write_byte(TE_EXPLOSION);
        
write_coord(iOrigin[0]);
        
write_coord(iOrigin[1]);
        
write_coord(iOrigin[2]);
        
write_short(sprite_blast);
        
write_byte(32); // scale
        
write_byte(20); // framerate
        
write_byte(0);// flags
        
message_end();
        new 
entlist[33];
        new 
numfound find_sphere_class(ent,"player"90.0 ,entlist32);
        
        for (new 
i=0numfoundi++)
        {        
            new 
pid entlist[i];
            
            if (!
is_user_alive(pid) || get_user_team(attacker) == get_user_team(pid))
                continue;
            
            
ExecuteHam(Ham_TakeDamagepidentattacker90.01);
        }
        
remove_entity(ent);
    }

Sorry for my not good English
CrazyChickenTest 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 07:13.


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