Raised This Month: $12 Target: $400
 3% 

Teleport bomb carrier to bomb site.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
suhdude
Senior Member
Join Date: Mar 2016
Location: Sweden
Old 11-14-2017 , 21:52   Teleport bomb carrier to bomb site.
Reply With Quote #1

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.

Last edited by suhdude; 11-14-2017 at 21:53.
suhdude is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 11-15-2017 , 15:11   Re: Teleport bomb carrier to bomb site.
Reply With Quote #2

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?
__________________
HamletEagle is offline
suhdude
Senior Member
Join Date: Mar 2016
Location: Sweden
Old 11-15-2017 , 15:25   Re: Teleport bomb carrier to bomb site.
Reply With Quote #3

Quote:
Originally Posted by HamletEagle View Post
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(); }

Last edited by suhdude; 11-15-2017 at 15:29.
suhdude is offline
wickedd
Veteran Member
Join Date: Nov 2009
Old 11-15-2017 , 15:47   Re: Teleport bomb carrier to bomb site.
Reply With Quote #4

Quote:
Originally Posted by suhdude View Post
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.
__________________
Just buy the fucking game!!!!
I hate No-Steamers and lazy ass people.
wickedd is offline
suhdude
Senior Member
Join Date: Mar 2016
Location: Sweden
Old 11-15-2017 , 16:41   Re: Teleport bomb carrier to bomb site.
Reply With Quote #5

Quote:
Originally Posted by wickedd View Post
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.

Last edited by suhdude; 11-15-2017 at 16:42.
suhdude is offline
wickedd
Veteran Member
Join Date: Nov 2009
Old 11-16-2017 , 10:50   Re: Teleport bomb carrier to bomb site.
Reply With Quote #6

Well I might write a plugin that will teleport the player with the bomb to a random bombsite.
Will that be ok?
__________________
Just buy the fucking game!!!!
I hate No-Steamers and lazy ass people.
wickedd is offline
Old 11-16-2017, 13:58
Alber9091
This message has been deleted by Alber9091. Reason: nvm
suhdude
Senior Member
Join Date: Mar 2016
Location: Sweden
Old 11-16-2017 , 15:30   Re: Teleport bomb carrier to bomb site.
Reply With Quote #7

Quote:
Originally Posted by wickedd View Post
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 View Post
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.

Last edited by suhdude; 11-16-2017 at 15:32.
suhdude is offline
wickedd
Veteran Member
Join Date: Nov 2009
Old 11-16-2017 , 16:01   Re: Teleport bomb carrier to bomb site.
Reply With Quote #8

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 ] )
}*/ 
__________________
Just buy the fucking game!!!!
I hate No-Steamers and lazy ass people.

Last edited by wickedd; 11-16-2017 at 16:20.
wickedd is offline
suhdude
Senior Member
Join Date: Mar 2016
Location: Sweden
Old 11-16-2017 , 23:30   Re: Teleport bomb carrier to bomb site.
Reply With Quote #9

Quote:
Originally Posted by wickedd View Post
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"
suhdude is offline
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 11-17-2017 , 05:34   Re: Teleport bomb carrier to bomb site.
Reply With Quote #10

Quote:
Originally Posted by wickedd View Post
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.
__________________
edon1337 is offline
Reply


Thread Tools
Display Modes

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 12:59.


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