Raised This Month: $51 Target: $400
 12% 

[REQ] Disable helmet on pistol rounds


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
versatile_bfg
Veteran Member
Join Date: Feb 2012
Old 08-13-2017 , 22:34   Re: [REQ] Disable helmet on pistol rounds
Reply With Quote #5

Quote:
Originally Posted by vortex. View Post
Sorry for late, here:
PHP Code:
#include <sourcemod>

int round;
bool noarmor false;

public 
Plugin myinfo 
{
    
name "No HELMET when pistol rounds",
    
author "Vortéx!",
    
version "1.0",
    
url "https://forums.alliedmods.net/showthread.php?t=299971"
}

public 
void OnPluginStart()
{
       
HookEvent("round_start"roundstart);
       
HookEvent("player_spawned"spawn);
}

public 
Action roundstart(Handle event, const char[] namebool dontBroadcast)

    
round GetTeamScore(2) + GetTeamScore(3) + 1;
    
    if(
round 4// first round
    
{
        
noarmor true;
    }
    else if(
round && round 16// finish pistol rounds  
    
{   
        
noarmor false;
    }
    else if(
round 15 && round 18// after half time
    
{
        
noarmor true;
    }
    else if(
round 17// finish pistol rounds
       
{   
        
noarmor false;
    }


public 
Action spawn(Handle event, const char[] namebool dontBroadcast)
{
    if(
noarmor)
    {
        
int id GetClientOfUserId(GetEventInt(event,"userid"));
        
SetEntProp(idProp_Send"m_bHasHelmet"0);
        
SetEntProp(idProp_Send"m_ArmorValue"00);
    }
}

public 
Action CS_OnBuyCommand(int client, const char[] sWeapon
{
    if(
noarmor)
    {    
        if (
StrContains(sWeapon"kevlar"false) != -|| StrContains(sWeapon"helmet"false) != -1
        { 
            
PrintToChat(client"You can not buy kevlar or helmet when pistol round");
            return 
Plugin_Handled;
        }
    }    
    return 
Plugin_Continue

Try this one, only changed how rounds are counted.
__________________
versatile_bfg is offline
 



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:56.


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