Raised This Month: $32 Target: $400
 8% 

Solved [CSGO] set the health of the terroist to be 9999 HP


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
WTF109
Junior Member
Join Date: Apr 2020
Old 04-30-2020 , 05:28   [CSGO] set the health of the terroist to be 9999 HP
Reply With Quote #1

1) How can I prevent the terrorist from taking damage from the counter terrorist ?


2) How do I set the health of the terroist to be 9999 HP ?


thank you in advance

Last edited by WTF109; 04-30-2020 at 08:47. Reason: SOLVED
WTF109 is offline
Rowdy4E
Junior Member
Join Date: Nov 2018
Location: Czech Republic
Old 04-30-2020 , 05:51   Re: [REQ] How can I prevent the terrorist from taking damage from the counter terrori
Reply With Quote #2

Quote:
Originally Posted by WTF109 View Post
1) How can I prevent the terrorist from taking damage from the counter terrorist ?


2) How do I set the health of the terroist to be 9999 HP ?


thank you in advance
1) Thanks to SDKHooks (SDKHook_OnTakeDamage)

2) SetEntityHealth(client, 9999);
__________________
Rowdy4E is offline
WTF109
Junior Member
Join Date: Apr 2020
Old 04-30-2020 , 08:39   Re: [REQ] How can I prevent the terrorist from taking damage from the counter terrori
Reply With Quote #3

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


new Handle:g_CvarCTHP INVALID_HANDLE;
new 
Handle:g_CvarTRHP INVALID_HANDLE;
new 
Handle:g_CvarCTAR INVALID_HANDLE;
new 
Handle:g_CvarTRAR INVALID_HANDLE;


public 
Plugin:myinfo = {
    
name "Set spawn health armor",
    
author "",
    
description "",
    
version "Final",
    
url ""
}

public 
OnPluginStart()
{
    
HookEvent("player_spawn"OnPlayerSpawn);
    
g_CvarCTHP CreateConVar("sm_CT_spawn_health""100""CT's Health when spawn"FCVAR_PLUGIN);
    
g_CvarTRHP CreateConVar("sm_T_spawn_health""9999""TR's Health when spawn"FCVAR_PLUGIN);
    
g_CvarCTAR CreateConVar("sm_CT_spawn_armor""0""CT's Armor when spawn(0~127)"FCVAR_PLUGINtrue0.0true127.0);
    
g_CvarTRAR CreateConVar("sm_T_spawn_armor""0""TR's Armor when spawn(0~127)"FCVAR_PLUGINtrue0.0true127.0);
}

public 
Action:OnPlayerSpawn(Handle:event, const String:name[], bool:dontBroadcast)
{
    new 
client GetClientOfUserId(GetEventInt(event"userid"));
    if (
IsPlayerAlive(client))
    {
        new 
team GetClientTeam(client);
        if (
team == 3)
        {
            
SetEntityHealth(clientGetConVarInt(g_CvarCTHP));
            
SetEntProp(clientProp_Send"m_ArmorValue"GetConVarInt(g_CvarCTAR), 1);
        }
        if (
team == 2)
        {
            
SetEntityHealth(clientGetConVarInt(g_CvarTRHP));
            
SetEntProp(clientProp_Send"m_ArmorValue"GetConVarInt(g_CvarTRAR), 1);
        }
    }

SOLVED

Last edited by WTF109; 04-30-2020 at 08:45.
WTF109 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:19.


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