AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   [CSGO] Buy Riot Shields for comp/community (https://forums.alliedmods.net/showthread.php?t=316118)

backwards 05-07-2019 18:56

[CSGO] Buy Riot Shields for comp/community
 
2 Attachment(s)
This Plugin Allow Players to Buy new Riot Shields for $5000 by typing !buyshield in chat.

*Updated to version 1.2.

https://i.imgur.com/ELIMmf5.jpg

https://i.imgur.com/K3VWQMT.jpg

Change Log:
v1.2 - Fixed an issue reported by wolvez04.
v1.1 - Adding only buying in spawn zone & mp_buytime.

TheDS1337 05-07-2019 19:16

Re: [CSGO] Buy Riot Shields for comp/community
 
You got it working, nice!

PS: was it just after today's little update that it worked? because I tried the same before and it didn't.

backwards 05-07-2019 20:26

Re: [CSGO] Buy Riot Shields for comp/community
 
Quote:

Originally Posted by TheDS1337 (Post 2650817)
You got it working, nice!

PS: was it just after today's little update that it worked? because I tried the same before and it didn't.

They enabled it with the update, I never figured out why it wasn't working prior. I speculate the entity wasn't fully embeded into the game yet although the entity type existed.

wolvez04 05-09-2019 04:51

Re: [CSGO] Buy Riot Shields for comp/community
 
Seems to be a bug when dropping your shield which can crash the server

When you drop your shield it still shows in your inventory but glitching out. Tried to pickup but couldn't and within seconds crash
CLagCompensationManager::StartLagCompensation with NULL CUserCmd!!!

backwards 05-09-2019 05:44

Re: [CSGO] Buy Riot Shields for comp/community
 
Quote:

Originally Posted by wolvez04 (Post 2650976)
Seems to be a bug when dropping your shield which can crash the server

When you drop your shield it still shows in your inventory but glitching out. Tried to pickup but couldn't and within seconds crash
CLagCompensationManager::StartLagCompensation with NULL CUserCmd!!!

Thanks for the report, problem resolved in the latest version 1.2.

arcticx2 05-09-2019 07:50

Re: [CSGO] Buy Riot Shields for comp/community
 
Quote:

Originally Posted by 1337norway (Post 2650980)
Thanks for the report, problem resolved in the latest version 1.2.

small issue : put "ShieldCost" into the text as well ,

PHP Code:

PrintToChat(client"Sorry you don't have $5000 to buy the shield."); 

i changed & i used new syntax :bacon!:

PHP Code:

#include <sourcemod>
#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(
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;



Enrory 05-10-2019 09:10

Re: [CSGO] Buy Riot Shields for comp/community
 
Thanks for this :)

Eren 05-10-2019 10:04

Re: [CSGO] Buy Riot Shields for comp/community
 
How to add more durability to the shield?

NitroN 05-10-2019 10:45

Re: [CSGO] Buy Riot Shields for comp/community
 
niceeee broooow! 100% work.. ty! :)

Ilusion9 05-10-2019 12:03

Re: [CSGO] Buy Riot Shields for comp/community
 
Quote:

Originally Posted by Eren (Post 2651100)
How to add more durability to the shield?

100% this entity has a netprop called m_iHealth, you can start with this.


All times are GMT -4. The time now is 17:39.

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