AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Teleport Block (https://forums.alliedmods.net/showthread.php?t=101215)

BigMac 08-21-2009 20:17

Teleport Block
 
<hamsandwich>

What i am trying to do is make a block where you could set start destination and end destination like BCM has it. I look at the BCM code but its different. Hmmm am i on the right track on getting this to work?


PHP Code:

new const g_property1_name[TOTAL_BLOCKS][] =
{
"Name"
}
new const 
g_property2_name[TOTAL_BLOCKS][] =
{
"Destination"
}
ActionTeleportBlock(ident)
{
    new 
tele entity_get_int(entEV_INT_iuser1);
    if ( !
tele ) return PLUGIN_HANDLED;
    static 
property[5];
    
    
GetProperty(ent1property);
    
entity_set_vector(idstr_to_num(property), g_set_velocity[id]);
    
    
GetProperty(ent2property);
    
g_set_velocity[id][2] = str_to_float(property);
    
    
entity_set_int(idEV_INT_gaitsequence6);
    
    static 
Float:tele_origin[3];
    
entity_get_vector(teleEV_VEC_origintele_origin);
    
    new 
player = -1;
    do
    {
        
player find_ent_in_sphere(playertele_origin16.0);
        
        if ( !
is_user_alive(player)
        || 
player == id
        
|| cs_get_user_team(id) == cs_get_user_team(player) ) continue;
        
        
user_kill(player1);
    }
    while ( 
player );
    
    
entity_set_vector(idEV_VEC_origintele_origin);
    
    static 
Float:velocity[3];
    
entity_get_vector(idEV_VEC_velocityvelocity);
    
velocity[2] = floatabs(velocity[2]);
    
entity_set_vector(idEV_VEC_velocityvelocity);
    
    return 
PLUGIN_HANDLED;


Anyone know how to make this work?

31m0_owns 08-23-2009 01:09

Re: Teleport Block
 
Ummm.... Maybe the obvious thing you could have done was replace the teleport sprites with a block model instead

I think that would be easier then adding a new block


All times are GMT -4. The time now is 14:58.

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