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

[CSGO] GivePlayerItem & SDKHook_WeaponDrop


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
PartialCloning
Senior Member
Join Date: Dec 2015
Old 03-01-2016 , 13:29   [CSGO] GivePlayerItem & SDKHook_WeaponDrop
Reply With Quote #1

Using GivePlayerItem on a player that already has a weapon of the same type forces the player to drop the weapon (or is it never equipped?!) but it does not go through the SDKHook_WeaponDrop hook. My question is am I doing something wrong or can I hook the weapon drop through a different hook?
PartialCloning is offline
SM9
Veteran Member
Join Date: Sep 2013
Location: United Kingdom
Old 03-01-2016 , 13:35   Re: [CSGO] GivePlayerItem & SDKHook_WeaponDrop
Reply With Quote #2

What are you trying to do when you hook the drop?
SM9 is offline
PartialCloning
Senior Member
Join Date: Dec 2015
Old 03-01-2016 , 16:27   Re: [CSGO] GivePlayerItem & SDKHook_WeaponDrop
Reply With Quote #3

Depends on the weapon. Some I want to save their ids, others I want to remove.
PartialCloning is offline
headline
SourceMod Moderator
Join Date: Mar 2015
Old 03-01-2016 , 16:58   Re: [CSGO] GivePlayerItem & SDKHook_WeaponDrop
Reply With Quote #4

If you don't want to give someone the same gun twice, check if they already have it.
headline is offline
KissLick
Veteran Member
Join Date: Nov 2012
Location: void
Old 03-01-2016 , 17:39   Re: [CSGO] GivePlayerItem & SDKHook_WeaponDrop
Reply With Quote #5

What about something like this (if you cant avoid that problem with hooking)?
PHP Code:
WeaponDropHook()
{
    
FUNC_A();
}

FOO()
{
    if (
client has weapon in the same slot)
        
FUNC_A();
    
    
GivePlayerItem();
}

FUNC_A()
{
    
some stuff here

__________________
Plugins: TeamGames
Includes: Menu stocks, ColorVariables, DownloadTableConfig

> No help through PM, make a topic.
KissLick 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 06:08.


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