Raised This Month: $ Target: $400
 0% 

[L4D2] !kill command Modification / Help Requests


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Darkwob
BANNED
Join Date: Oct 2018
Old 08-14-2020 , 05:52   [L4D2] !kill command Modification / Help Requests
Reply With Quote #1

I want a new feature added to this plugin. Can you help me? I want this plugin not to let infected people commit suicide when the ghost is in fashion, and if they want to kill, an hint message appears.
Hint message;
You can't kill yourself in Ghost mode.

PHP Code:
#include <sourcemod>
#include <sdktools>

#define PLUGIN_VERSION "1.0"

public Plugin:myinfo 
    {
        
name "[L4D] Kill for Infected",
        
author "Danny & FlamFlam",
        
description "use the !kill command in chat",
        
version PLUGIN_VERSION,
        
url ""
    
}

    public 
OnPluginStart()
    {
        
RegConsoleCmd("sm_explode"Kill_Me);
        
RegConsoleCmd("sm_kill"Kill_Me);
    }


    
// kill
    
public Action:Kill_Me(clientargs)
    {
        if (
GetClientTeam(client) == 3)
        {
        
ForcePlayerSuicide(client);
        }
        else
        {
        
PrintToChat(client"You have to be Infected")
        }
    }

    
//Timed Message
    
public bool:OnClientConnect(clientString:rejectmsg[], maxlen)

    {
        
CreateTimer(60.0Timer_Advertiseclient);
        return 
true;
    }

    public 
Action:Timer_Advertise(Handle:timerany:client)

    {
        if(
IsClientInGame(client))
        
PrintHintText(client"Type in chat !kill to kill yourself");
        else if (
IsClientConnected(client))
        
CreateTimer(60.0Timer_Advertiseclient);
    } 
This version of the plug-in is for infected.

Last edited by Darkwob; 08-14-2020 at 05:53.
Darkwob is offline
XDglory
Member
Join Date: May 2012
Old 08-14-2020 , 11:26   Re: [L4D2] !kill command Modification / Help Requests
Reply With Quote #2

Add a check of "m_isGhost" might do.

Code:
GetEntProp( client, Prop_Send, "m_isGhost" )
XDglory is offline
Darkwob
BANNED
Join Date: Oct 2018
Old 08-15-2020 , 11:30   Re: [L4D2] !kill command Modification / Help Requests
Reply With Quote #3

Quote:
Originally Posted by XDglory View Post
Add a check of "m_isGhost" might do.

Code:
GetEntProp( client, Prop_Send, "m_isGhost" )
I don't know which line to add, but I'd appreciate it if you could help me. In the meantime, I want a message yazmasınıda "you can't kill yourself in Ghost " in the form of how can we do it?
Darkwob is offline
Marttt
Veteran Member
Join Date: Jan 2019
Location: Brazil
Old 08-18-2020 , 03:31   Re: [L4D2] !kill command Modification / Help Requests
Reply With Quote #4

Try this version (based on XDglory tip)

Spoiler
Attached Files
File Type: sp Get Plugin or Get Source (l4d_kill_infected_v1_0_1.sp - 153 views - 1.7 KB)
__________________

Last edited by Marttt; 08-18-2020 at 03:31.
Marttt 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 03:23.


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