Raised This Month: $ Target: $400
 0% 

Join spec, kill player


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Qvantry
Junior Member
Join Date: Aug 2012
Old 01-06-2014 , 22:29   Join spec, kill player
Reply With Quote #1

Hey, when I want the player to join spectator using this:

PHP Code:
public CmdSpectator(iPlayer)
{
    
cs_set_user_team(iPlayerCS_TEAM_SPECTATOR);
    
ColorChat(iPlayerGREY"^4%s You joined ^4Spectator^1!"TAG)

But I also want to kill the player that joins spec, how do I kill him?
Qvantry is offline
11922911
Senior Member
Join Date: Dec 2011
Location: Yuen Long Country
Old 01-06-2014 , 22:33   Re: Join spec, kill player
Reply With Quote #2

Quote:
Originally Posted by Qvantry View Post
Hey, when I want the player to join spectator using this:

PHP Code:
public CmdSpectator(iPlayer)
{
    
cs_set_user_team(iPlayerCS_TEAM_SPECTATOR);
    
ColorChat(iPlayerGREY"^4%s You joined ^4Spectator^1!"TAG)

But I also want to kill the player that joins spec, how do I kill him?
Quote:
/* Kills player. When flag is set to 1 then death won't decrase frags. */
native user_kill(index,flag=0);
__________________
youtube:
@holla16

Last edited by 11922911; 01-06-2014 at 22:33.
11922911 is offline
Qvantry
Junior Member
Join Date: Aug 2012
Old 01-07-2014 , 00:16   Re: Join spec, kill player
Reply With Quote #3

I don't understand what to do with that, when I write it in CmdSpectator I get errors, and when I write the native outside of it and just write user_kill inside CmdSpectator I also get errors.
Qvantry is offline
11922911
Senior Member
Join Date: Dec 2011
Location: Yuen Long Country
Old 01-07-2014 , 00:35   Re: Join spec, kill player
Reply With Quote #4

Try:
PHP Code:
public CmdSpectator(iPlayer)
{
    
user_kill(iPlayer0);
    
cs_set_user_team(iPlayerCS_TEAM_SPECTATOR);
    
ColorChat(iPlayerGREY"^4%s You joined ^4Spectator^1!"TAG);

Use user_kill(iPlayer, 1) If you don't want to lose frags.
__________________
youtube:
@holla16

Last edited by 11922911; 01-07-2014 at 00:38.
11922911 is offline
Qvantry
Junior Member
Join Date: Aug 2012
Old 01-07-2014 , 11:36   Re: Join spec, kill player
Reply With Quote #5

Quote:
Originally Posted by 11922911 View Post
Try:
PHP Code:
public CmdSpectator(iPlayer)
{
    
user_kill(iPlayer0);
    
cs_set_user_team(iPlayerCS_TEAM_SPECTATOR);
    
ColorChat(iPlayerGREY"^4%s You joined ^4Spectator^1!"TAG);

Use user_kill(iPlayer, 1) If you don't want to lose frags.
Thanks, works perfectly
Qvantry 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 10:09.


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