AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Teleport after 3 seconds (https://forums.alliedmods.net/showthread.php?t=84966)

mazmaajinsh 02-03-2009 15:18

Teleport after 3 seconds
 
Hello.
Could someone please edit this snippet for me, so it teleports all players after 3 seconds? I dont have an idea how to to that :D Thanks.
Code:

public jc_start_cup(id)
{
        for( new i = 0 ; i < 33; i++)
        {
                finish_locs[i][0] = 0.0
                finish_locs[i][1] = 0.0
                finish_locs[i][2] = 0.0
                climber[i] = ""
        }
       
        cup_start_id = id
       
        cup_start_time = -1
        cup_status = CUP_STATUS_RUNNING
       
        announcments = 0
        if( cup_rr_start )
        {
                set_cvar_string( "sv_restartround", "1")
                set_cvar_string( "kz_checkpoints", "0")
                set_cvar_string( "amx_pausecfg", "pause prokreedz_hook")
                set_task(1.0,"time_remaining",8638459,"",0,"b")
                client_print(0,print_chat,"[%s] Jump Cup has been started!", jc_pluginname )
        }
        else
        {
                set_cvar_string( "kz_checkpoints", "0")
                cup_start_countdown = CUP_START_COUNTDOWN
               
                set_task(1.0,"start_countdown",8638458,"",0,"b")
               
                new Float:vOrigin[3];
                pev(id, pev_origin, vOrigin);
                new players[32], num;
                get_players(players, num, "ach", "");
                for( new i = 0; i < num; i++ )

                client_print(0,print_chat,"[%s] Jump Cup will start in %d seconds!", jc_pluginname, cup_start_countdown )
        }
       
        set_task(2.5,"enable_godmode",8638457,"",0)
       
        return PLUGIN_HANDLED
}


padilha007 02-03-2009 16:36

Re: Teleport after 3 seconds
 
teleport to...

mazmaajinsh 02-04-2009 07:38

Re: Teleport after 3 seconds
 
it should teleport players to location where player who used a command to start cup is standing.

anakin_cstrike 02-05-2009 03:26

Re: Teleport after 3 seconds
 
You have to make a random origin near the admin's origin; you can't move all players to the same origin, i think...

Try this
PHP Code:

public commandid )
{
    new
    
FloatpOrigin],
    
MyArray35 ] = { 01, ... },
    
ijrandtemp35 ];
        
    
pevidpev_originpOrigin );
    
    for( ; 
35i++ )
    {
        
rand random_num2560 );
        if( !
temprand ] )
        {
            
MyArray] = rand;
            
temprand ] = 1;
        }
        else --
i;
    }
    
    for( 
1<= g_maxplayersi++ )
    {
        if( !
is_user_alive) )
            continue;
            
        for( 
035i++ )
            
engfuncEngFunc_SetOriginjMyArray] );
    }
    
    return 
PLUGIN_HANDLED;


Credit

xPaw 02-05-2009 08:15

Re: Teleport after 3 seconds
 
why? maybe he is using semiclip. or just while teleporting set both to solid_not, and then to normal with settask

mazmaajinsh 02-08-2009 16:53

Re: Teleport after 3 seconds
 
Quote:

Originally Posted by xPaw (Post 756101)
why? maybe he is using semiclip. or just while teleporting set both to solid_not, and then to normal with settask

thats right, im using semiclip

anakin_cstrike 02-09-2009 08:37

Re: Teleport after 3 seconds
 
Then this is enough
PHP Code:

#include <amxmodx>
#include <fakemeta>

new FloatfOrigin], g_maxplayers;
public 
plugin_init()
{
    
g_maxplayers get_maxplayers();
}

public 
commandid )
{
    
pevidpev_originfOrigin );
    
set_task3.0"teleport" );
}

public 
teleport()
{
    for( new 
1<= g_maxplayersi++ )
    {
        if( !
is_user_alive) )
            continue;
        
engfuncEngFunc_SetOriginifOrigin );
    }



mazmaajinsh 02-13-2009 17:06

Re: Teleport after 3 seconds
 
Quote:

Originally Posted by anakin_cstrike (Post 758692)
Then this is enough
PHP Code:

#include <amxmodx>
#include <fakemeta>

new FloatfOrigin], g_maxplayers;
public 
plugin_init()
{
    
g_maxplayers get_maxplayers();
}

public 
commandid )
{
    
pevidpev_originfOrigin );
    
set_task3.0"teleport" );
}

public 
teleport()
{
    for( new 
1<= g_maxplayersi++ )
    {
        if( !
is_user_alive) )
            continue;
        
engfuncEngFunc_SetOriginifOrigin );
    }



this works, but it doesnt teleport to location of the player who used command. it teleports to someone else.

mazmaajinsh 02-14-2009 11:33

Re: Teleport after 3 seconds
 
sorry. anyone please?

anakin_cstrike 02-15-2009 02:18

Re: Teleport after 3 seconds
 
:-/

PHP Code:

#include <amxmodx>
#include <amxmisc>
#include <fakemeta>

new g_maxplayers;

public 
plugin_init()
{
    
register_clcmd"say /teleport""teleport_cmd" );
    
g_maxplayers get_maxplayers();
}

public 
teleport_cmdid )
{
    if( !
accessidADMIN_BAN ) )
        return 
PLUGIN_HANDLED;
    
    
set_task3.0"teleport_task"id );
    return 
PLUGIN_CONTINUE;
}

public 
teleport_taskindex )
{
    new 
Float:fOrigin];
    
pevindexpev_originfOrigin );
    
    for( new 
1<= g_maxplayersi++ )
    {
        if( !
is_user_alive) )
            continue;
        if( 
== index )
            continue;
            
        
engfuncEngFunc_SetOriginifOrigin );
    }




All times are GMT -4. The time now is 01:41.

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