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

[REQ] Disable helmet on pistol rounds


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
trzmielu
Member
Join Date: Aug 2016
Old 07-31-2017 , 18:35   [REQ] Disable helmet on pistol rounds
Reply With Quote #1

Hello,

I am searching for a plugin that will block buying a kevlar+helmet on pistol rounds (rounds left: 30 and 15). VIP's on my server are getting free kevlar and they're buying helmet on pistol rounds and players without vip are getting mad, cuz they can't kill them w/ 1 headshot

Regards
trzmielu is offline
vortex.
AlliedModders Donor
Join Date: Jan 2017
Location: OnGameFrame()
Old 07-31-2017 , 19:43   Re: [REQ] Disable helmet on pistol rounds
Reply With Quote #2

Yes, I can do it. But I have to ask a question for this. Only for the first round and first round after half time, Right?
__________________

Last edited by vortex.; 07-31-2017 at 19:43.
vortex. is offline
trzmielu
Member
Join Date: Aug 2016
Old 07-31-2017 , 19:47   Re: [REQ] Disable helmet on pistol rounds
Reply With Quote #3

Yep
trzmielu is offline
vortex.
AlliedModders Donor
Join Date: Jan 2017
Location: OnGameFrame()
Old 08-01-2017 , 14:58   Re: [REQ] Disable helmet on pistol rounds
Reply With Quote #4

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 
void OnMapStart()
{
    
round 0;
}

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

    
round++;
    
    if(
round == 1// first round
    
{
        
noarmor true;
    }
    else if(
round == 4// finish pistol rounds  
    
{   
        
noarmor false;
    }
    else if(
round == 16// after half time
    
{
        
noarmor true;
    }
    else if(
round == 18// 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

__________________
vortex. is offline
trzmielu
Member
Join Date: Aug 2016
Old 08-01-2017 , 17:15   Re: [REQ] Disable helmet on pistol rounds
Reply With Quote #5

Hello,

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

Regards
trzmielu is offline
vortex.
AlliedModders Donor
Join Date: Jan 2017
Location: OnGameFrame()
Old 08-01-2017 , 18:14   Re: [REQ] Disable helmet on pistol rounds
Reply With Quote #6

I do not think so.
__________________
vortex. is offline
SZOKOZ
Member
Join Date: Jan 2014
Old 08-02-2017 , 14:44   Re: [REQ] Disable helmet on pistol rounds
Reply With Quote #7

If the mod restart the match like mp_restartgame then I don't think the above snippet will work. You could try detecting when the match restarts and resetting the round counter @vortex.
__________________
May still be available for SM scripting. Just look at my Steam profile regarding my availability.
My Steam

Last edited by SZOKOZ; 08-02-2017 at 14:44.
SZOKOZ is offline
trzmielu
Member
Join Date: Aug 2016
Old 08-04-2017 , 16:03   Re: [REQ] Disable helmet on pistol rounds
Reply With Quote #8

Plugin isn't working after theese restarts, if it's possible try to lock helmet when rounds left are: 30 and 15

Regards
trzmielu is offline
mrmatthew2k
Junior Member
Join Date: Jun 2015
Old 08-09-2017 , 12:06   Re: [REQ] Disable helmet on pistol rounds
Reply With Quote #9

try this really shitty code i wrote

PHP Code:
#pragma semicolon 1

#define DEBUG

#include <sourcemod>
#include <sdktools>
Handle maxrounds;

public 
Plugin:myinfo 
{
    
name "no armor pistols",
    
author "mrmatthew2k",
    
description "no armor pistols",
    
version "1.0",
    
url ""
};

public 
OnPluginStart()
{
    
HookEvent("round_start"OnRoundStart); 
    
maxrounds FindConVar("mp_maxrounds");
}

public 
void OnRoundStart(Event event, const String:name[], bool:dontBroadcast)
{
    if ((
GetTeamScore(2) + GetTeamScore(3)) == (GetConVarInt(maxrounds) / 2) || (GetTeamScore(2) + GetTeamScore(3)) < 1)
    {
        for (new 
client 1client < (MaxClients 1); client++)
        {
            if (
IsClientConnected(client))
            {
                if (
IsPlayerAlive(client))
                {
                    
SetEntProp(clientProp_Send"m_bHasHelmet"0);
                
                }
            
            }
            
        }
            
    }
            

mrmatthew2k is offline
trzmielu
Member
Join Date: Aug 2016
Old 08-13-2017 , 21:15   Re: [REQ] Disable helmet on pistol rounds
Reply With Quote #10

Hello,

Sadly, I must say that your plugin is not working, but thank you for post

Regards
trzmielu 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 02:32.


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