AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Suggestions / Requests (https://forums.alliedmods.net/forumdisplay.php?f=12)
-   -   Teleport bomb carrier to bomb site. (https://forums.alliedmods.net/showthread.php?t=302898)

suhdude 11-14-2017 21:52

Teleport bomb carrier to bomb site.
 
I need a plugin that teleports the player carrying the bomb to a bomb site after spawning.
Or just spawning on the bomb site would be good enough.

Actually, spawning a planted bomb on a bomb site would also work.

I tried looking in telemenu.sma, but I could not make use of anything there.

Thanks.

HamletEagle 11-15-2017 15:11

Re: Teleport bomb carrier to bomb site.
 
Try looking in bomb status, there's a menu that allows admins to teleport to a bomb site(a/b). But the code is pretty complicated so I'm not sure you will understand.

So, what do you need? Spawn a planted bomb or move the carrier to a random bombsite?

suhdude 11-15-2017 15:25

Re: Teleport bomb carrier to bomb site.
 
Quote:

Originally Posted by HamletEagle (Post 2560694)
Try looking in bomb status, there's a menu that allows admins to teleport to a bomb site(a/b). But the code is pretty complicated so I'm not sure you will understand.

So, what do you need? Spawn a planted bomb or move the carrier to a random bombsite?

We play retake scenarios together on my server right now.
And it looks like this:

T spawn on B site (using the map spawn editor plugin)
CT spawn outside B site and in tunnels.
Both teams are given full gear, but some different grenades.
The bomb is automatically given to every terrorist, and a plugin forces the player touching the bomb zone to plant the bomb instantly on spawn, all other bombs are deleted.

This works alright, only problem is that you can only have 5 terrorist spawn points because someone has to touch the bombzone. So you can't spread the spawn points around and make it different.

So the best thing would be if the bomb was automatically planted on round start, without a player having to plant it.

This is the plugin I'm using right now to force plant the bomb.
I basically slaughtered other peoples code and put something together, not very pretty.
Code:
new g_c4timer new mp_c4timer public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR);     register_event("HLTV", "new_round", "a", "1=0", "2=0");     register_event("HLTV", "event_hltv", "a", "1=0", "2=0")     mp_c4timer  = get_cvar_pointer("mp_c4timer") } public event_hltv()     g_c4timer = get_pcvar_num(mp_c4timer) public plugin_precache() precache_sound("radio/bombpl.wav"); stock is_user_in_plant_zone( id ) {     return (cs_get_user_mapzones(id) & CS_MAPZONE_BOMBTARGET) } public new_round() {     new players[32];     new playercount, i;     get_players(players, playercount);     for (i=0; i<playercount; i++)         set_task(0.5,"plant_bomb",players[i]);     return PLUGIN_CONTINUE; } public plant_bomb(id) {     if ( is_user_in_plant_zone( id ) )     {         set_task(0.5,"PlantABomb", id);         set_task(10.5,"change_clock", id);         emit_sound(0,CHAN_AUTO,"radio/bombpl.wav",VOL_NORM,ATTN_NORM,0,PITCH_NORM);     } }   public PlantABomb( player ) {     new iEntity = create_entity( "weapon_c4" );     if( !iEntity )         return;           DispatchKeyValue( iEntity, "detonatedelay", "0" );     DispatchSpawn( iEntity );           new Float:origin[ 3 ];       pev( player, pev_origin, origin );             origin[ 0 ] += 30.0     // or     origin[ 1 ] += 30.0               engfunc( EngFunc_SetOrigin, iEntity, origin );             force_use( iEntity, iEntity ); // This plants it } public change_clock(id) { message_begin(MSG_ALL, get_user_msgid("RoundTime")) write_short (g_c4timer); message_end(); }

wickedd 11-15-2017 15:47

Re: Teleport bomb carrier to bomb site.
 
Quote:

Originally Posted by suhdude (Post 2560700)
This works alright, only problem is that you can only have 5 terrorist spawn points because someone has to touch the bombzone. So you can't spread the spawn points around and make it different.

Why can't you spread them out? You can put 1 spawn in the bomb zone and the other 4 near the bomb zone.

suhdude 11-15-2017 16:41

Re: Teleport bomb carrier to bomb site.
 
Quote:

Originally Posted by wickedd (Post 2560714)
Why can't you spread them out? You can put 1 spawn in the bomb zone and the other 4 near the bomb zone.

This is what I have done, but sometimes we are only 4 vs 4.
This means bomb is not always planted.

Also it would be much better to be able to place 25 spawn points, then you can make it less predictable where terrorists are.
And you can mix it up much more and make the scenarios different.

wickedd 11-16-2017 10:50

Re: Teleport bomb carrier to bomb site.
 
Well I might write a plugin that will teleport the player with the bomb to a random bombsite.
Will that be ok?

suhdude 11-16-2017 15:30

Re: Teleport bomb carrier to bomb site.
 
Quote:

Originally Posted by wickedd (Post 2560835)
Well I might write a plugin that will teleport the player with the bomb to a random bombsite.
Will that be ok?

If its random it will be hard for me to know where to place spawns.
The bomb carrier will spawn on A maybe, when the spawn points are set to spawn on B.
So one player will then be alone on A.

If you can spawn a bomb or teleport the bomb carrier to coordinates, I can add the those myself.
I don't mind if it only teleports to bombsite B on dust2, maybe I can compile multiple plugins for all maps with different coordinates.

Thank you.

Quote:

Originally Posted by Alber9091 (Post 2560870)
I have no rights to interupt. But it will be again manual. Like player has to plant. He said, he had plugin with /plant anf bomb gets planted. So! In my point of view, things are still similar.

If the bomb carrier is teleported to the bomb site, my autoplant plugin will detect that he is in the plant zone and then plant it.
The only thing I will change is that the plugin gives everyone the bomb, and deletes every bomb that isnt planted.

So it will work.

wickedd 11-16-2017 16:01

Re: Teleport bomb carrier to bomb site.
 
Here you go, this will teleport the player with the bomb to bombsite B in Dust2. It will teleport them after the
freeze time is over.
PHP Code:

#include < amxmodx >
#include < fun >

new const bomb_orgin[ ][ ] =
{
    { -
1555275936 },  // Bombsite coordinates
    
{ -1623266036 },
    { -
1540262336 }
}

public 
plugin_init( )
{
    
register_plugin"Bomb Teleport""1.0""Suhdude" )
    
register_logevent"start_round"2"1=Round_Start" )  
    
//register_clcmd( "say /get", "job" )  // uncomment this to get coordinates
    
}

public 
start_round( )
{
    new 
players32 ], inumidi
    get_players
playersinum"ae""TERRORIST" )
    
    for( 
0inumi++ )
    {
        
id players]
        if( 
user_has_weaponidCSW_C4 ) ) 
        {
            
set_task0.9"move"id  )
        }
    }
}

public 
moveid )
{
    new 
p_origin]
        
    
p_origin bomb_orginrandomsizeofbomb_orgin ) ) ]
    
set_user_originidp_origin )
    
    
remove_taskid )
}

/*public job( id )
{
    new origin[ 3 ]
    get_user_origin( id, origin )
    
    log_amx( "%i | %i | %i", origin[ 0 ], origin[ 1 ], origin[ 2 ] )
}*/ 


suhdude 11-16-2017 23:30

Re: Teleport bomb carrier to bomb site.
 
Quote:

Originally Posted by wickedd (Post 2560889)
Here you go, this will teleport the player with the bomb to bombsite B in Dust2. It will teleport them after the
freeze time is over.
PHP Code:

#include < amxmodx >
#include < fun >

new const bomb_orgin[ ][ ] =
{
    { -
1555275936 },  // Bombsite coordinates
    
{ -1623266036 },
    { -
1540262336 }
}

public 
plugin_init( )
{
    
register_plugin"Bomb Teleport""1.0""Suhdude" )
    
register_logevent"start_round"2"1=Round_Start" )  
    
//register_clcmd( "say /get", "job" )  // uncomment this to get coordinates
    
}

public 
start_round( )
{
    new 
players32 ], inumidi
    get_players
playersinum"ae""TERRORIST" )
    
    for( 
0inumi++ )
    {
        
id players]
        if( 
user_has_weaponidCSW_C4 ) ) 
        {
            
set_task0.9"move"id  )
        }
    }
}

public 
moveid )
{
    new 
p_origin]
        
    
p_origin bomb_orginrandomsizeofbomb_orgin ) ) ]
    
set_user_originidp_origin )
    
    
remove_taskid )
}

/*public job( id )
{
    new origin[ 3 ]
    get_user_origin( id, origin )
    
    log_amx( "%i | %i | %i", origin[ 0 ], origin[ 1 ], origin[ 2 ] )
}*/ 


Hey, thanks. Nice that you added the get coordinates too!
When I try to compile, I get:
"Error: Array sizes do not match, or destination array is too small on line 38"

edon1337 11-17-2017 05:34

Re: Teleport bomb carrier to bomb site.
 
Quote:

Originally Posted by wickedd (Post 2560889)
Here you go, this will teleport the player with the bomb to bombsite B in Dust2. It will teleport them after the
freeze time is over.
PHP Code:

#include < amxmodx >
#include < fun >

new const bomb_orgin[ ][ ] =
{
    { -
1555275936 },  // Bombsite coordinates
    
{ -1623266036 },
    { -
1540262336 }
}

public 
plugin_init( )
{
    
register_plugin"Bomb Teleport""1.0""Suhdude" )
    
register_logevent"start_round"2"1=Round_Start" )  
    
//register_clcmd( "say /get", "job" )  // uncomment this to get coordinates
    
}

public 
start_round( )
{
    new 
players32 ], inumidi
    get_players
playersinum"ae""TERRORIST" )
    
    for( 
0inumi++ )
    {
        
id players]
        if( 
user_has_weaponidCSW_C4 ) ) 
        {
            
set_task0.9"move"id  )
        }
    }
}

public 
moveid )
{
    new 
p_origin]
        
    
p_origin bomb_orginrandomsizeofbomb_orgin ) ) ]
    
set_user_originidp_origin )
    
    
remove_taskid )
}

/*public job( id )
{
    new origin[ 3 ]
    get_user_origin( id, origin )
    
    log_amx( "%i | %i | %i", origin[ 0 ], origin[ 1 ], origin[ 2 ] )
}*/ 


Why are you specifying the coordinates? You can just use pev_origin with info_bomb_target / func_bomb_target as the entity.


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

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