AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugin/Gameplay Ideas and Requests (https://forums.alliedmods.net/forumdisplay.php?f=60)
-   -   [REQ] Disable helmet on pistol rounds (https://forums.alliedmods.net/showthread.php?t=299971)

trzmielu 07-31-2017 18:35

[REQ] Disable helmet on pistol rounds
 
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 :)

vortex. 07-31-2017 19:43

Re: [REQ] Disable helmet on pistol rounds
 
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?

trzmielu 07-31-2017 19:47

Re: [REQ] Disable helmet on pistol rounds
 
Yep

vortex. 08-01-2017 14:58

Re: [REQ] Disable helmet on pistol rounds
 
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



trzmielu 08-01-2017 17:15

Re: [REQ] Disable helmet on pistol rounds
 
Hello,

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

Regards

vortex. 08-01-2017 18:14

Re: [REQ] Disable helmet on pistol rounds
 
I do not think so.

SZOKOZ 08-02-2017 14:44

Re: [REQ] Disable helmet on pistol rounds
 
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.

trzmielu 08-04-2017 16:03

Re: [REQ] Disable helmet on pistol rounds
 
Plugin isn't working after theese restarts, if it's possible try to lock helmet when rounds left are: 30 and 15

Regards

mrmatthew2k 08-09-2017 12:06

Re: [REQ] Disable helmet on pistol rounds
 
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);
                
                }
            
            }
            
        }
            
    }
            



trzmielu 08-13-2017 21:15

Re: [REQ] Disable helmet on pistol rounds
 
Hello,

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

Regards


All times are GMT -4. The time now is 05:16.

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