Raised This Month: $32 Target: $400
 8% 

Remove player's weapon base on life stat


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ambn
Veteran Member
Join Date: Feb 2015
Location: Fun servers
Old 09-19-2019 , 06:02   Remove player's weapon base on life stat
Reply With Quote #1

Hi there,
What i'm trying to do is remove a player's weapon when they drop it and when they are alive but when they got killed they drop the weapon

i used SDKHooks to do so and used SDKHOOK_WeaponDropPost to handle the stuff but the thing is when ever i use IsPlayerAlive it returns true it's like dropping the weapon happens before the actual player death where the IsPlayerAlive function could return false

is there any tips you guys can provide me? thanks
__________________

Last edited by ambn; 09-19-2019 at 06:02.
ambn is offline
Halt
Senior Member
Join Date: Jan 2015
Location: Black Mesa
Old 09-19-2019 , 11:16   Re: Remove player's weapon base on life stat
Reply With Quote #2

So you want the weapon deleted when a player drops it but is still alive? And when they drop it when they die you want it to stay?
Halt is offline
ambn
Veteran Member
Join Date: Feb 2015
Location: Fun servers
Old 09-19-2019 , 11:18   Re: Remove player's weapon base on life stat
Reply With Quote #3

yeap, that's it, i've tried getting the owner do some timer delaying stuff but it's still too buggy and will bug other parts of my script too which makes more of destruction that it fixes
I'm out of idea since that sdkhook stuff triggers too soon, any better method?
__________________

Last edited by ambn; 09-19-2019 at 11:19.
ambn is offline
Ilusion9
Veteran Member
Join Date: Jun 2018
Location: Romania
Old 09-20-2019 , 05:21   Re: Remove player's weapon base on life stat
Reply With Quote #4

use requestframe or a timer inside sdk_dropweaponpost. send the weapon's ref and the client's userid.
__________________
Ilusion9 is offline
ambn
Veteran Member
Join Date: Feb 2015
Location: Fun servers
Old 09-20-2019 , 12:05   Re: Remove player's weapon base on life stat
Reply With Quote #5

Quote:
Originally Posted by Ilusion9 View Post
use requestframe or a timer inside sdk_dropweaponpost. send the weapon's ref and the client's userid.
is it possible to pass more than 1 parameters through the timer? i used a work around using the weapon's owner and previous owner and it looks it works but still looking for easier ones, could you explain it if it's possible?

Oh well i could use Data-packs i forgot that exists , i'll give that a try
__________________

Last edited by ambn; 09-20-2019 at 12:49.
ambn 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 18:39.


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