Raised This Month: $275 Target: $400
 68% 

CS:GO Plugin Modify (1 kill + 5hp)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
MonsteQ
Member
Join Date: May 2018
Old 07-10-2018 , 07:08   CS:GO Plugin Modify (1 kill + 5hp)
Reply With Quote #1

Hey!

I have a plugin

please help me!

PHP Code:
#include <sourcemod> 

#pragma semicolon 1 
#pragma newdecls required 

ConVar g_cvHPEnable

public 
Plugin myinfo =  
{  
     
name "1 Kill/+5 HP jogra",  
     
author ""
     
description "+5 HP / kill jogra."
     
version "1.0"
     
url ""
}; 

public 
void OnPluginStart() 

    
g_cvHPEnable CreateConVar("hp_enable""1""Bővítmény bekapcsolva?\n(0: Kikapcsolva)\n(1: Bekapcsolva)"); 
     
    
HookEvent("player_death"ePlayerDeath); 
    
HookEvent("player_spawn"Event_Spawn); 
     
    
AutoExecConfig(true"hp_kills_for_admins"); 


public 
Action ePlayerDeath(Event event, const char[] namebool dontBroadcast

    
int iAttacker GetClientOfUserId(event.GetInt("attacker")); 
     
    if (
g_cvHPEnable.IntValue == 0
    { 
        return 
Plugin_Handled
    } 
     
    if (
IsClientInGame(iAttacker)) 
    { 
        if (
CheckCommandAccess(iAttacker""ADMFLAG_CUSTOM6)) 
        { 
            
int iNewHealth GetClientHealth(iAttacker) + 5
             
            
SetEntityHealth(iAttackeriNewHealth); 
        } 
    } 
     
    return 
Plugin_Continue


public 
Action Event_Spawn(Event hEvent, const char[] sNamebool bDontBroadcast

    
int iClient GetClientOfUserId(hEvent.GetInt("userid")); 
     
    
SetEntProp(iClientProp_Send"m_ArmorValue"100); 
    
SetEntProp(iClientProp_Send"m_bHasHelmet"1); 

How do I modify it to work with that flag (ADMFLAG_CUSTOM6) only?
▼▼▼

This block:
PHP Code:
public Action Event_Spawn(Event hEvent, const char[] sNamebool bDontBroadcast

    
int iClient GetClientOfUserId(hEvent.GetInt("userid")); 
     
    
SetEntProp(iClientProp_Send"m_ArmorValue"100); 
    
SetEntProp(iClientProp_Send"m_bHasHelmet"1); 

__________________


My Banner - My Server
--------------------------------

Last edited by MonsteQ; 07-10-2018 at 07:13.
MonsteQ is offline
Dr.Mohammad
Senior Member
Join Date: Jan 2016
Old 07-10-2018 , 07:57   Re: CS:GO Plugin Modify (1 kill + 5hp)
Reply With Quote #2

you can used this thraed:
https://forums.alliedmods.net/showthread.php?t=307697
or
PHP Code:
#include <sourcemod> 
#pragma semicolon 1 
#pragma newdecls required 
#define HP_VERSION "1.0" 

public Plugin myinfo 

     
name "1 Kill/+5 HP for Admins"
     
author "Psyk0tik (Crasher_3637), MonsteQ, sidezz"
     
description "Gives +5 HP per kill for admins."
     
version HP_VERSION
     
url "https://forums.alliedmods.net/showthread.php?t=307697" 
}; 

ConVar g_cvHPEnable
ConVar g_cvHPAdmin;

public 
void OnPluginStart() 

     
g_cvHPEnable CreateConVar("hp_enable""1""Enable plugin?\n(0: OFF)\n(1: ON)"); 
     
g_cvHPAdmin CreateConVar("hp_admin""0""Enable plugin only for Admin?\n(0: OFF)\n(1: ON)"); 
     
CreateConVar("hp_version"HP_VERSION"Plugin version."FCVAR_NOTIFY|FCVAR_DONTRECORD); 
     
HookEvent("player_death"ePlayerDeath); 
     
AutoExecConfig(true"hp_kills_for_admins"); 


public 
Action ePlayerDeath(Event event, const char[] namebool dontBroadcast)   
{
    if (!
g_cvHPEnable.BoolValue)
    {
        return 
Plugin_Handled;
    }
    
int iAttacker GetClientOfUserId(event.GetInt("attacker"));
    
int iVictim GetClientOfUserId(event.GetInt("userid"));
    if ((!
g_cvHPAdmin.BoolValue || (g_cvHPAdmin.BoolValue && IsAdminAllowed(iAttacker))) && IsValidClient(iAttacker) && iAttacker != iVictim)
    {
        
SetEntityHealth(iAttackerGetClientHealth(iAttacker) + 5);
    }
    return 
Plugin_Continue;   
}  

stock bool IsValidClient(int client

     return (
client && client <= MaxClients && IsClientInGame(client) && !IsClientInKickQueue(client) && IsPlayerAlive(client)); 


stock bool IsAdminAllowed(int client

     return (
CheckCommandAccess(client"hp_override"ADMFLAG_CUSTOM6false)); 

Dr.Mohammad is offline
MonsteQ
Member
Join Date: May 2018
Old 07-10-2018 , 11:27   Re: CS:GO Plugin Modify (1 kill + 5hp)
Reply With Quote #3

Yes, I used this thread. It's my plugin request and my thread, just I want a modify.
__________________


My Banner - My Server
--------------------------------
MonsteQ is offline
Dr.Mohammad
Senior Member
Join Date: Jan 2016
Old 07-10-2018 , 12:33   Re: CS:GO Plugin Modify (1 kill + 5hp)
Reply With Quote #4

Quote:
Originally Posted by MonsteQ View Post
Yes, I used this thread. It's my plugin request and my thread, just I want a modify.
What changes you need for this script ؟
Dr.Mohammad is offline
MonsteQ
Member
Join Date: May 2018
Old 07-10-2018 , 17:07   Re: CS:GO Plugin Modify (1 kill + 5hp)
Reply With Quote #5

Quote:
Originally Posted by Dr.Mohammad View Post
What changes you need for this script ؟
__________________


My Banner - My Server
--------------------------------

Last edited by MonsteQ; 07-10-2018 at 17:08.
MonsteQ is offline
Dr.Mohammad
Senior Member
Join Date: Jan 2016
Old 07-10-2018 , 17:57   Re: CS:GO Plugin Modify (1 kill + 5hp)
Reply With Quote #6

try this:

PHP Code:
#include <sourcemod>
#pragma semicolon 1
#pragma newdecls required
#define HP_VERSION "1.1"

public Plugin myinfo =
{
     
name "1 Kill/+5 HP for Admins",
     
author "Psyk0tik (Crasher_3637), MonsteQ, sidezz, Dr.Mohammad",
     
description "Gives +5 HP per kill for admins.",
     
version HP_VERSION,
     
url "https://forums.alliedmods.net/showthread.php?t=307697"
};

ConVar g_cvHPEnable;
ConVar g_cvHPAdmin;

public 
void OnPluginStart()
{
    
g_cvHPEnable CreateConVar("hp_enable""1""Enable plugin?\n(0: OFF)\n(1: ON)");
    
g_cvHPAdmin CreateConVar("hp_admin""0""Enable plugin only for Admin?\n(0: OFF)\n(1: ON)");
    
CreateConVar("hp_version"HP_VERSION"Plugin version."FCVAR_NOTIFY|FCVAR_DONTRECORD);
    
HookEvent("player_death"ePlayerDeath);
    
HookEvent("player_spawn"Event_Spawn);
    
AutoExecConfig(true"hp_kills_for_admins");
}

public 
Action ePlayerDeath(Event event, const char[] namebool dontBroadcast)
{
    if (!
g_cvHPEnable.BoolValue)
    {
        return 
Plugin_Handled;
    }
    
    
int iAttacker GetClientOfUserId(event.GetInt("attacker"));
    
int iVictim GetClientOfUserId(event.GetInt("userid"));
    
    if ((!
g_cvHPAdmin.BoolValue || (g_cvHPAdmin.BoolValue && IsAdminAllowed(iAttacker))) && IsValidClient(iAttacker) && iAttacker != iVictim)
    {
        
SetEntityHealth(iAttackerGetClientHealth(iAttacker) + 5);
    }
    return 
Plugin_Continue;
}

public 
Action Event_Spawn(Event hEvent, const char[] sNamebool bDontBroadcast)
{
    if (!
g_cvHPEnable.BoolValue)
    {
        return 
Plugin_Handled;
    }
    
    
int iClient GetClientOfUserId(hEvent.GetInt("userid"));
    
    if (!
g_cvHPAdmin.BoolValue || (g_cvHPAdmin.BoolValue && IsAdminAllowed(iClient)))
    {
        
SetEntProp(iClientProp_Send"m_ArmorValue"100);
        
SetEntProp(iClientProp_Send"m_bHasHelmet"1);
    }
    return 
Plugin_Continue;
}

stock bool IsValidClient(int client)
{
    return (
client && client <= MaxClients && IsClientInGame(client) && !IsClientInKickQueue(client) && IsPlayerAlive(client));
}

stock bool IsAdminAllowed(int client)
{
    return (
CheckCommandAccess(client"hp_override"ADMFLAG_CUSTOM6false));

Attached Files
File Type: sp Get Plugin or Get Source (1.sp - 6 views - 2.1 KB)

Last edited by Dr.Mohammad; 07-10-2018 at 18:04.
Dr.Mohammad is offline
Reply


Thread Tools
Display Modes

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 01:39.


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