AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   How to change range of mines (https://forums.alliedmods.net/showthread.php?t=132550)

CrazyChickenTest 07-16-2010 03:51

How to change range of mines
 
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

Arkshine 07-16-2010 09:17

Re: How to change range of mines
 
find_sphere_class -> change 90.0 by an higher value.

CrazyChickenTest 07-16-2010 09:35

Re: How to change range of mines
 
thx for help I will try it

CrazyChickenTest 07-16-2010 15:36

Re: How to change range of mines
 
sry for post after post but I set it to 300 and it doesn't work for me . Still range is the same as default ;/

Arkshine 07-16-2010 17:09

Re: How to change range of mines
 
range of what ? Explosion effect or the damage ?

CrazyChickenTest 07-16-2010 17:34

Re: How to change range of mines
 
range of touch mine

Arkshine 07-16-2010 17:37

Re: How to change range of mines
 
So try to play in entity_set_size(). Like -32, -32 and 32 32 it will scale by 2 the mine's size.

CrazyChickenTest 07-16-2010 18:18

Re: How to change range of mines
 
thx very much


All times are GMT -4. The time now is 07:13.

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