Raised This Month: $319 Target: $400
 79%   Almost there!

[CS:GO] Remove healthshot at round end


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
FurYXO
Junior Member
Join Date: Feb 2018
Old 09-18-2021 , 07:10   [CS:GO] Remove healthshot at round end
Reply With Quote #1

Hey!
I have an plugin which gives healthshot to VIP players.
I have a problem with it, when the round ends, and the next round is starting, the healthshots is getting dropped into to floor, because the limit is 1 in the server.

I want to remove the non used healthshots at the end of the round. Here is the code:

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

#pragma semicolon 1
#pragma newdecls required

public Plugin myinfo =
{
    
name "MagyarHNS VIP Gránátok",
    
description "Healthshot a VIP-eknek",
    
author "Ervin",
    
version "1.0.0",
    
url "www.magyarhns.hu"
};

public 
void OnPluginStart()
{
    
HookEvent("player_spawn"Event_PlayerSpawnEventHookMode_Post);
}

public 
void Event_PlayerSpawn(Event hEvent, const char[] sEventNamebool bDontBroadcast)
{
    
int userid hEvent.GetInt("userid");
    
    if (
IsClientInGame(GetClientOfUserId(userid)))
    {
        
CreateTimer(0.3Timer_DelayuseridTIMER_FLAG_NO_MAPCHANGE);
    }
}

public 
Action Timer_Delay(Handle hTimerint userid)
{
    
int client GetClientOfUserId(userid);

    if(
IsClientInGame(client) && CheckCommandAccess(client"lofasz"ADMFLAG_CUSTOM6))
    {
        switch (
GetClientTeam(client))
        {
            case 
2:
            {
                
GivePlayerItem(client"weapon_healthshot");
            }
            case 
3:
            {
                
GivePlayerItem(client"weapon_healthshot");
            }
        }
    }

FurYXO is offline
Rohanlogs
Senior Member
Join Date: Nov 2015
Old 09-19-2021 , 10:45   Re: [CS:GO] Remove healthshot at round end
Reply With Quote #2

A wise man once said

Quote:
Originally Posted by headline View Post
If you don't want to give someone the same gun twice, check if they already have it.
So, try this.

Spoiler
__________________
Rohanlogs is offline
8guawong
AlliedModders Donor
Join Date: Dec 2013
Location: BlackMarke7
Old 09-20-2021 , 03:38   Re: [CS:GO] Remove healthshot at round end
Reply With Quote #3

maybe this is what you want

"mp_equipment_reset_rounds" = "0"
FCVAR_GAMEDLL FCVAR_REPLICATED FCVAR_RELEASE
- Reset all player equipment every N rounds (0 for never)
__________________
8guawong is offline
Austin
Senior Member
Join Date: Oct 2005
Old 09-21-2021 , 17:30   Re: [CS:GO] Remove healthshot at round end
Reply With Quote #4

This probably doesn't apply to your question,
but FYI you can set the number to have and if they are dropped on death.

ammo_item_limit_healthshot 4
mp_death_drop_healthshot 1
Austin 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 12:04.


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