Raised This Month: $ Target: $400
 0% 

Teleport bomb carrier to bomb site.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
wickedd
Veteran Member
Join Date: Nov 2009
Old 11-16-2017 , 16:01   Re: Teleport bomb carrier to bomb site.
Reply With Quote #1

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 #2

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 #3

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
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 11-17-2017 , 06:35   Re: Teleport bomb carrier to bomb site.
Reply With Quote #4

Quote:
Originally Posted by edon1337 View Post
Why are you specifying the coordinates? You can just use pev_origin with info_bomb_target / func_bomb_target as the entity.
Then you need a lot more code to make sure you don't spawn the player on some boxes/walls/in the air.
__________________
HamletEagle is offline
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 11-17-2017 , 13:29   Re: Teleport bomb carrier to bomb site.
Reply With Quote #5

Quote:
Originally Posted by HamletEagle View Post
Then you need a lot more code to make sure you don't spawn the player on some boxes/walls/in the air.
His current coordinates aren’t valid for every map, just dust2.
__________________
edon1337 is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 11-17-2017 , 13:56   Re: Teleport bomb carrier to bomb site.
Reply With Quote #6

Quote:
Originally Posted by edon1337 View Post
His current coordinates aren’t valid for every map, just dust2.
And the user is asking for a plugin that works only in dust2, that's why I'm saying it's fine. Of course, if you were to release such plugin you would have to use a more general method, without hardcoding.
But this is not a plugin submissions, just a request(in which is fine if you do stuff that's specific to that request only, mind blowing, I know).
__________________
HamletEagle 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 17:19.


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