AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   How to send player to spectators in right way? (https://forums.alliedmods.net/showthread.php?t=217716)

alter 06-06-2013 13:00

How to send player to spectators in right way?
 
How to send player to spectators in right way? (Should i kill him, and than set, or other way?)

akcaliberg 06-06-2013 14:38

Re: How to send player to spectators in right way?
 
user_silentkill( id )
cs_set_user_team(id , CS_TEAM_SPECTATOR)

Found this in amx_super.

yokomo 06-06-2013 15:34

Re: How to send player to spectators in right way?
 
Something like this:
PHP Code:

#include <amxmodx>
#include <cstrike>

public plugin_init()
{
    
register_clcmd("say /spec""CmdGoSpec")
}

public 
CmdGoSpec(id)
{
    if(
is_user_alive(id))
    {
        
user_silentkill(id)
        
cs_set_user_team(id3)
    }
    else 
cs_set_user_team(id3);



Kellan123 06-06-2013 15:56

Re: How to send player to spectators in right way?
 
try this :)

PHP Code:

#include <amxmodx>
#include <cstrike>
 
public plugin_init()
{
register_clcmd("say /spec""spec_go")
 
register_clcmd("say /unspec""spec_back")
}
 
public 
spec_go(id)
{
if(
is_user_alive(id))
{
cs_set_user_team(idCS_TEAM_SPECTATOR)
user_kill(id1)
}
 
public 
spec_back(id)
{
if (
cs_get_user_team(id) == CS_TEAM_SPECTATOR)
cs_set_user_team(idrandom_num(12))



yokomo 06-07-2013 02:24

Re: How to send player to spectators in right way?
 
Quote:

Originally Posted by Kellan123 (Post 1965820)
try this :)

PHP Code:

#include <amxmodx>
#include <cstrike>
 
public plugin_init()
{
register_clcmd("say /spec""spec_go")
 
register_clcmd("say /unspec""spec_back")
}
 
public 
spec_go(id)
{
if(
is_user_alive(id))
{
cs_set_user_team(idCS_TEAM_SPECTATOR)
user_kill(id1)
}
 
public 
spec_back(id)
{
if (
cs_get_user_team(id) == CS_TEAM_SPECTATOR)
cs_set_user_team(idrandom_num(12))



Better to make sure player die before transfer him to Spectator team.

.Dare Devil. 06-07-2013 07:21

Re: How to send player to spectators in right way?
 
Quote:

Originally Posted by Kellan123 (Post 1965820)
try this :)

PHP Code:

#include <amxmodx>
#include <cstrike>
 
public plugin_init()
{
register_clcmd("say /spec""spec_go")
 
register_clcmd("say /unspec""spec_back")
}
 
public 
spec_go(id)
{
if(
is_user_alive(id))
{
cs_set_user_team(idCS_TEAM_SPECTATOR)
user_kill(id1)
}
 
public 
spec_back(id)
{
if (
cs_get_user_team(id) == CS_TEAM_SPECTATOR)
cs_set_user_team(idrandom_num(12))



with your code, the hud will disappear

guipatinador 06-07-2013 08:38

Re: How to send player to spectators in right way?
 
Quote:

Originally Posted by yokomo (Post 1965801)
Something like this:
PHP Code:

public CmdGoSpec(id)
{
    if(
is_user_alive(id))
    {
        
user_silentkill(id)
        
cs_set_user_team(id3)
    }
    else 
cs_set_user_team(id3);



Why not,

PHP Code:

public CmdGoSpec(id)
{
    if(
is_user_alive(id))
    {
        
user_silentkill(id)
    }
    
    
cs_set_user_team(id3);



yokomo 06-07-2013 09:08

Re: How to send player to spectators in right way?
 
Quote:

Originally Posted by guipatinador (Post 1966133)
Why not,

PHP Code:

public CmdGoSpec(id)
{
    if(
is_user_alive(id))
    {
        
user_silentkill(id)
    }
    
    
cs_set_user_team(id3);



Both do the same thing :)

alter 06-07-2013 12:06

Re: How to send player to spectators in right way?
 
Thnx for everyone!


All times are GMT -4. The time now is 16:15.

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