Raised This Month: $ Target: $400
 0% 

How to send player to spectators in right way?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
alter
Member
Join Date: Jan 2013
Location: Lithuainia
Old 06-06-2013 , 13:00   How to send player to spectators in right way?
Reply With Quote #1

How to send player to spectators in right way? (Should i kill him, and than set, or other way?)
__________________
Class: Programmer Level: Medium

Last edited by alter; 06-06-2013 at 13:02.
alter is offline
akcaliberg
Senior Member
Join Date: Nov 2011
Location: Istanbul
Old 06-06-2013 , 14:38   Re: How to send player to spectators in right way?
Reply With Quote #2

user_silentkill( id )
cs_set_user_team(id , CS_TEAM_SPECTATOR)

Found this in amx_super.
akcaliberg is offline
yokomo
Surprise Ascot!
Join Date: May 2010
Location: Malaysia
Old 06-06-2013 , 15:34   Re: How to send player to spectators in right way?
Reply With Quote #3

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);

yokomo is offline
Kellan123
AlliedModders Donor
Join Date: Aug 2012
Old 06-06-2013 , 15:56   Re: How to send player to spectators in right way?
Reply With Quote #4

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))


Last edited by Kellan123; 06-06-2013 at 16:02.
Kellan123 is offline
yokomo
Surprise Ascot!
Join Date: May 2010
Location: Malaysia
Old 06-07-2013 , 02:24   Re: How to send player to spectators in right way?
Reply With Quote #5

Quote:
Originally Posted by Kellan123 View Post
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.
yokomo is offline
.Dare Devil.
Veteran Member
Join Date: Sep 2010
Old 06-07-2013 , 07:21   Re: How to send player to spectators in right way?
Reply With Quote #6

Quote:
Originally Posted by Kellan123 View Post
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
.Dare Devil. is offline
guipatinador
SourceMod Donner Party
Join Date: Oct 2009
Location: Poortugal
Old 06-07-2013 , 08:38   Re: How to send player to spectators in right way?
Reply With Quote #7

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

guipatinador is offline
yokomo
Surprise Ascot!
Join Date: May 2010
Location: Malaysia
Old 06-07-2013 , 09:08   Re: How to send player to spectators in right way?
Reply With Quote #8

Quote:
Originally Posted by guipatinador View Post
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
yokomo is offline
alter
Member
Join Date: Jan 2013
Location: Lithuainia
Old 06-07-2013 , 12:06   Re: How to send player to spectators in right way?
Reply With Quote #9

Thnx for everyone!
__________________
Class: Programmer Level: Medium
alter is offline
Reply



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 16:15.


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