AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Weapon Pickup Event (https://forums.alliedmods.net/showthread.php?t=245033)

FuckFace32 07-27-2014 10:16

Weapon Pickup Event
 
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.

hornet 07-27-2014 10:40

Re: Weapon Pickup Event
 
Let's start with you telling what you actually want to do.

Flick3rR 07-27-2014 10:49

Re: Weapon Pickup Event
 
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.

SpeeDeeR 07-27-2014 10:58

Re: Weapon Pickup Event
 
https://wiki.alliedmods.net/Half-Lif...nts#WeapPickup

hornet 07-27-2014 11:09

Re: Weapon Pickup Event
 
Quote:

Originally Posted by Flick3rR (Post 2174648)
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().

FuckFace32 07-27-2014 14:01

Re: Weapon Pickup Event
 
Quote:

Originally Posted by hornet (Post 2174643)
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


All times are GMT -4. The time now is 13:17.

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