Raised This Month: $ Target: $400
 0% 

Weapon Pickup Event


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
FuckFace32
Junior Member
Join Date: Jul 2014
Location: Romania
Old 07-27-2014 , 10:16   Weapon Pickup Event
Reply With Quote #1

I cant really find the event that's called when the weapon is picked up(I found register_touch("weaponbox", "player", "OnWeaponWalkOver"), but that's called when you walk over a weapon, and if you don't pick it up it's still called. I need it to be called only when you actually pick it up)

PS: I need this for Counter-Strike.

Last edited by FuckFace32; 07-27-2014 at 10:16.
FuckFace32 is offline
hornet
AMX Mod X Plugin Approver
Join Date: Mar 2010
Location: Australia
Old 07-27-2014 , 10:40   Re: Weapon Pickup Event
Reply With Quote #2

Let's start with you telling what you actually want to do.
__________________
Quote:
vBulletin Tip #42: Not much would be accomplished by merging this item with itself.
hornet is offline
FuckFace32
Junior Member
Join Date: Jul 2014
Location: Romania
Old 07-27-2014 , 14:01   Re: Weapon Pickup Event
Reply With Quote #3

Quote:
Originally Posted by hornet View Post
Let's start with you telling what you actually want to do.
Well, I want to give the terrorist some kind of godmode when he's doing a free round. He can't be killed UNTIL he picks up a weapon. The only problem I've got is detecting the weapon pickup.

This is what I've got:

Code:
#include <amxmodx>

public plugin_init() 
{
	register_plugin( "Testing stuff" , "1.0" , "FuckFace" )

	register_event( "WeapPickup", "OnWeaponPickedUp", "be" )
}

public OnWeaponPickedUp( id )
{
	new WeaponID = read_data( 1 )
	
	server_print( "WeaponID: %i", WeaponID )
}
I think I can continue. Please T/C

Last edited by FuckFace32; 07-27-2014 at 14:04.
FuckFace32 is offline
Flick3rR
Veteran Member
Join Date: Feb 2014
Location: Bulgaria, Stara Zagora
Old 07-27-2014 , 10:49   Re: Weapon Pickup Event
Reply With Quote #4

You can use Ham_Touch with weaponbox, too. Check if the user has weapon and return if so.
And yes, explain what are you actually trying to do.
__________________
Flick3rR is offline
Send a message via Skype™ to Flick3rR
hornet
AMX Mod X Plugin Approver
Join Date: Mar 2010
Location: Australia
Old 07-27-2014 , 11:09   Re: Weapon Pickup Event
Reply With Quote #5

Quote:
Originally Posted by Flick3rR View Post
You can use Ham_Touch with weaponbox, too. Check if the user has weapon and return if so.
Touch() is not a good way for detecting weapon pickup, rather just preempting it.
There are much better ways such as WeapPickup event and AddPlayerItem().
__________________
Quote:
vBulletin Tip #42: Not much would be accomplished by merging this item with itself.
hornet is offline
SpeeDeeR
Veteran Member
Join Date: Mar 2010
Location: Bulgaria
Old 07-27-2014 , 10:58   Re: Weapon Pickup Event
Reply With Quote #6

https://wiki.alliedmods.net/Half-Lif...nts#WeapPickup
SpeeDeeR is offline
Old 07-28-2014, 16:24
baneado
This message has been deleted by baneado. Reason: already posted
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 13:17.


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