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

[REQ] Disable helmet on pistol rounds


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

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
yash1441
Senior Member
Join Date: Feb 2015
Location: Illuminati HQ
Old 08-14-2017 , 01:11   Re: [REQ] Disable helmet on pistol rounds
Reply With Quote #12

Quote:
Originally Posted by trzmielu View Post
Hello,

I am using Warmod [BFG] on my server and I have restarts there, won't be this a problem?

Regards
Use these from the warmod include.

PHP Code:
/**
 *  called when a match starting LiveOn3 
 * 
 * @noreturn        
 */
forward void OnLiveOn3(); 
and

PHP Code:
/**
 *  called when a match reaches half time
 *  includes when in overtime
 * 
 * @noreturn
 */
forward void OnHalfTime(const char[] ct_nameint ct_scoreint t_score, const char[] t_name); 
__________________

Last edited by yash1441; 08-14-2017 at 01:12.
yash1441 is offline
Send a message via Skype™ to yash1441
trzmielu
Member
Join Date: Aug 2016
Old 02-08-2018 , 21:36   Re: [REQ] Disable helmet on pistol rounds
Reply With Quote #13

Hello,

can some1 explain what yash is talking about? What should i put in warmod.inc?

Regards
trzmielu is offline
SZOKOZ
Member
Join Date: Jan 2014
Old 02-09-2018 , 06:03   Re: [REQ] Disable helmet on pistol rounds
Reply With Quote #14

It's more directed towards the person who will make this plugin for you. If anyone...
Is your server still in need of this? It's been months since you've posted this... Damn I feel sorry for those non VIPs. Add me on steam, I'll see when I can get this to you.
__________________
May still be available for SM scripting. Just look at my Steam profile regarding my availability.
My Steam
SZOKOZ is offline
alphaearth
Senior Member
Join Date: Feb 2018
Location: Turkey
Old 01-20-2019 , 13:32   Re: [REQ] Disable helmet on pistol rounds
Reply With Quote #15

not working. Would you fix it?
__________________
alphaearth 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 04:25.


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