Raised This Month: $ Target: $400
 0% 

[CSGO] Buy Riot Shields for comp/community


Post New Thread Reply   
 
Thread Tools Display Modes
Author
Franc1sco
Veteran Member
Join Date: Oct 2010
Location: Spain (Madrid)
Plugin ID:
6561
Plugin Version:
Plugin Category:
Gameplay
Plugin Game:
Counter-Strike: GO
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    Allow Players to Buy new Riot Shields
    Old 05-10-2019 , 16:28   Re: [CSGO] Buy Riot Shields for comp/community
    Reply With Quote #1

    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
    eyal282
    Veteran Member
    Join Date: Aug 2011
    Old 10-11-2021 , 12:27   Re: [CSGO] Buy Riot Shields for comp/community
    Reply With Quote #2

    Quote:
    Originally Posted by Ilusion9 View Post
    100% this entity has a netprop called m_iHealth, you can start with this.
    ] find shield
    "mp_shield_speed_deployed" = "170" client replicated - The max speed of a player when they have a shield deployed
    "mp_shield_speed_holstered" = "200" client replicated - The max speed of a player when they have a shield holstered
    "r_drawshieldstencil" = "1" client cheat
    "r_drawshieldstencil_debug" = "0" client cheat
    "sv_shield_bash_damage_to_nonplayer" = "30" client replicated
    "sv_shield_bash_damage_to_players" = "90" client replicated
    "sv_shield_explosive_damage_cap" = "99" client replicated
    "sv_shield_explosive_damage_crouch_bonus" = "10" client replicated
    "sv_shield_explosive_damage_mindist" = "30" client replicated
    "sv_shield_explosive_damage_mult" = "4" client replicated
    "sv_shield_explosive_damage_scale" = "0.5" client replicated
    "sv_shield_hitpoints" = "850" client replicated
    "sv_shield_purchase_restricted_to" = "ct" client replicated - restrict shield purchases to specific team
    __________________
    I am available to make plugins for pay.

    Discord: Eyal282#1334
    eyal282 is offline
    Thommen
    Member
    Join Date: May 2019
    Old 05-10-2019 , 17:11   Re: [CSGO] Buy Riot Shields for comp/community
    Reply With Quote #3

    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 #4

    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 #5

    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 #6

    Does anybody know how to set these vars like sv_shield_hitpoints?
    In which file should i look for it?
    Thommen 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 #7

    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
    laenss
    Member
    Join Date: Feb 2017
    Old 05-13-2019 , 14:16   Re: [CSGO] Buy Riot Shields for comp/community
    Reply With Quote #8

    I want to be able to use only one team. How can I make CT available?
    laenss 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 #9

    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 #10

    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
    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 17:43.


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