Raised This Month: $51 Target: $400
 12% 

Solved Clear client nades


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
kratoss1812
Senior Member
Join Date: May 2018
Location: Romānia
Old 07-21-2018 , 08:50   Clear client nades
Reply With Quote #1

I coded a plugin for vip core, it gives all nades to a vip at spawn.

The problem is that when a player spawns with a flash or another nade that is not used, the plugin automatically drop the nade in addition on the ground and this create lag.

How can i set the number of nades to 0 before give them?

Last edited by kratoss1812; 07-21-2018 at 14:26.
kratoss1812 is offline
LenHard
Senior Member
Join Date: Jan 2016
Old 07-21-2018 , 09:38   Re: Clear client nades
Reply With Quote #2

Make a check, check if the player has that certain nade before giving it to him. In smlib/clients.inc, there's a stock called Client_HasWeapon. You should try it out.
__________________
LenHard is offline
Franc1sco
Veteran Member
Join Date: Oct 2010
Location: Spain (Madrid)
Old 07-21-2018 , 13:01   Re: Clear client nades
Reply With Quote #3

PHP Code:
    int weapon;
    while ((
weapon GetPlayerWeaponSlot(clientCS_SLOT_GRENADE)) != -1)   // strip all the nades
    
{
        
RemovePlayerItem(clientweapon);
        
AcceptEntityInput(weapon"Kill");
    }
    
    
// give nades 
__________________
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.


Last edited by Franc1sco; 07-21-2018 at 13:15.
Franc1sco is offline
Send a message via MSN to Franc1sco
kratoss1812
Senior Member
Join Date: May 2018
Location: Romānia
Old 07-21-2018 , 14:22   Re: Clear client nades
Reply With Quote #4

thanks
kratoss1812 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 05:22.


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