Raised This Month: $32 Target: $400
 8% 

[CSGO] Buy Riot Shields for comp/community


Post New Thread Reply   
 
Thread Tools Display Modes
Franc1sco
Veteran Member
Join Date: Oct 2010
Location: Spain (Madrid)
Old 05-10-2019 , 16:28   Re: [CSGO] Buy Riot Shields for comp/community
Reply With Quote #11

Quote:
Originally Posted by Ilusion9 View Post
100% this entity has a netprop called m_iHealth, you can start with this.
I tried with
PHP Code:
int shield GivePlayerItem(client"weapon_shield");
SetEntProp(shieldProp_Data"m_iHealth"999999999); 
and
PHP Code:
int shield GivePlayerItem(client"weapon_shield");
SetEntProp(shieldProp_Data"m_takeDamage"01); 
but didnt work. Also teammates can break your shield. I will continue trying.
__________________
Veteran Coder -> Activity channel
Coding on CS2 and taking paid and free jobs.

Contact: Steam, Telegram or discord ( franug ).

You like my work? +Rep in my steam profile comments or donate.

Franc1sco is offline
Send a message via MSN to Franc1sco
Thommen
Member
Join Date: May 2019
Old 05-10-2019 , 17:11   Re: [CSGO] Buy Riot Shields for comp/community
Reply With Quote #12

Awesome plugin my friend!
Still, can anybody try to fix the issue that your teammate can destroy the shield and it takes only few shots
This plugin may be a top now! Congrats again! <3
Thommen is offline
TheBOSS
Member
Join Date: Nov 2018
Old 05-10-2019 , 20:27   Re: [CSGO] Buy Riot Shields for comp/community
Reply With Quote #13

what's cvar to change damage hit for shield?
TheBOSS is offline
backwards
AlliedModders Donor
Join Date: Feb 2014
Location: USA
Old 05-10-2019 , 20:30   Re: [CSGO] Buy Riot Shields for comp/community
Reply With Quote #14

Quote:
Originally Posted by TheBOSS View Post
what's cvar to change damage hit for shield?
"sv_shield_hitpoints" default "650"

This appears to work.
__________________
I highly recommend joining the SourceMod Discord Server for real time support.

Last edited by backwards; 05-10-2019 at 20:47.
backwards is offline
Thommen
Member
Join Date: May 2019
Old 05-12-2019 , 06:38   Re: [CSGO] Buy Riot Shields for comp/community
Reply With Quote #15

Does anybody know how to set these vars like sv_shield_hitpoints?
In which file should i look for it?
Thommen is offline
laenss
Member
Join Date: Feb 2017
Old 05-13-2019 , 14:16   Re: [CSGO] Buy Riot Shields for comp/community
Reply With Quote #16

I want to be able to use only one team. How can I make CT available?
laenss is offline
Ilusion9
Veteran Member
Join Date: Jun 2018
Location: Romania
Old 05-14-2019 , 06:44   Re: [CSGO] Buy Riot Shields for comp/community
Reply With Quote #17

Quote:
Originally Posted by Thommen View Post
Does anybody know how to set these vars like sv_shield_hitpoints?
In which file should i look for it?
in your gamemode cfg
example (if you run competitive mode) in cfg/gamemode_competitive_server.cfg
__________________
Ilusion9 is offline
r3v
Senior Member
Join Date: Feb 2016
Location: Lithuania, Vilnius
Old 05-25-2019 , 07:58   Re: [CSGO] Buy Riot Shields for comp/community
Reply With Quote #18

How to allow to use the command !buyshield only to counter-terrorists?
r3v is offline
arcticx2
Senior Member
Join Date: Nov 2011
Old 05-25-2019 , 10:43   Re: [CSGO] Buy Riot Shields for comp/community
Reply With Quote #19

Quote:
Originally Posted by r3v View Post
How to allow to use the command !buyshield only to counter-terrorists?
untested !

PHP Code:
#include <sourcemod>
#include <cstrike>
#include <sdktools>

#pragma newdecls required

public Plugin myinfo =
{
    
name "BuyShield",
    
author "backwards",
    
description "Allows players to buy shields by typing !buyshield.",
    
version SOURCEMOD_VERSION,
    
url "http://www.steamcommunity.com/id/mypassword"
}

int ShieldCost 5000
bool RequireBuyZone 
true;
Handle BuyStartRoundTimer;

public 
void OnPluginStart()
{
    
RegConsoleCmd("sm_buyshield"BuyShieldCMD);
    
HookEvent("round_prestart"Event_RoundPreStart);
}

public 
Action BuyShieldCMD(int clientint args
{
    if(
GetClientTeam(client) == CS_TEAM_CT)
    {
        if(
RequireBuyZone)
        {
            
bool InBuyZone view_as<bool>(GetEntProp(clientProp_Send"m_bInBuyZone"));
            if(!
InBuyZone)
            {
                
PrintToChat(client"Sorry You're Not In a Buy Zone.");
                return 
Plugin_Handled;
            }
            if (
BuyStartRoundTimer == null)
            {
                
PrintToChat(client"The Buy Time Has Expired For This Round.")
                return 
Plugin_Handled;
            }
        }
        
        
int account GetEntProp(clientProp_Send"m_iAccount");
        if(
account ShieldCost)
        {
            
PrintToChat(client"Sorry you don't have $%i to buy the shield." ShieldCost);
            return 
Plugin_Handled;
        }
        
        
int weaponIdx GetPlayerWeaponSlot(client11);
        
        if(
weaponIdx != -1)
        {
            if(
IsValidEdict(weaponIdx) && IsValidEntity(weaponIdx))
            {
                
char className[128];
                
GetEntityClassname(weaponIdxclassNamesizeof(className));
                
                if(
StrEqual("weapon_shield"className))
                {
                    
PrintToChat(client"You are already carrying a shield.");
                    return 
Plugin_Handled;
                }
            }
        }
        
        
SetEntProp(clientProp_Send"m_iAccount"account ShieldCost);
        
GivePlayerItem(client"weapon_shield");
        
PrintToChat(client"You've bought a shield.");
        
        return 
Plugin_Handled;
    }
}

public 
void Event_RoundPreStart(Handle eventchar[] namebool dontBroadcast)
{
    
float BuyTime 45.0;
    
ConVar cvarBuyTime FindConVar("mp_buytime");
    
    if(
cvarBuyTime != null)
        
BuyTime float(cvarBuyTime.IntValue);
        
    if (
BuyStartRoundTimer != null)
    {
        
KillTimer(BuyStartRoundTimer);
        
BuyStartRoundTimer null;
    }
    
    
BuyStartRoundTimer CreateTimer(BuyTimeStopBuying);
}


public 
Action StopBuying(Handle timerany client)
{
    
BuyStartRoundTimer null;
    
    return 
Plugin_Stop;


Last edited by arcticx2; 05-25-2019 at 10:44.
arcticx2 is offline
r3v
Senior Member
Join Date: Feb 2016
Location: Lithuania, Vilnius
Old 05-25-2019 , 11:34   Re: [CSGO] Buy Riot Shields for comp/community
Reply With Quote #20

Working! Thank You
r3v 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 05:05.


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