Raised This Month: $ Target: $400
 0% 

Block team move while alive


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
dustinandband
Senior Member
Join Date: May 2015
Old 08-29-2018 , 03:07   Re: Block team move while alive
Reply With Quote #1

What Game is it? Does this work?

PHP Code:
#include <sourcemod>

public Plugin:myinfo =
{
    
name "block team change",
    
author "dustin",
    
description "blocks team change command when players are alive",
    
version "1.0",
    
url "",
};

public 
OnPluginStart()
{
    
AddCommandListener(CommandJoinTeam"jointeam");
}

public 
Action CommandJoinTeam(client, const char[] commandargs)
{
    if (
IsPlayerAlive(client))
    {
        
ReplyToCommand(client"You Can't Use this command while alive.")
        return 
Plugin_Handled;
    }
    
    return 
Plugin_Continue;

dustinandband is offline
Ilusion9
Veteran Member
Join Date: Jun 2018
Location: Romania
Old 08-29-2018 , 15:07   Re: Block team move while alive
Reply With Quote #2

Quote:
Originally Posted by dustinandband View Post
What Game is it? Does this work?

PHP Code:
#include <sourcemod>

public Plugin:myinfo =
{
    
name "block team change",
    
author "dustin",
    
description "blocks team change command when players are alive",
    
version "1.0",
    
url "",
};

public 
OnPluginStart()
{
    
AddCommandListener(CommandJoinTeam"jointeam");
}

public 
Action CommandJoinTeam(client, const char[] commandargs)
{
    if (
IsPlayerAlive(client))
    {
        
ReplyToCommand(client"You Can't Use this command while alive.")
        return 
Plugin_Handled;
    }
    
    return 
Plugin_Continue;

You should check first if the client != 0 and if the client is in game.
Ilusion9 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 13:22.


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