View Single Post
Author Message
spunkster21
Senior Member
Join Date: Aug 2008
Old 09-29-2009 , 10:55   Help Blocking Events - Newbie to SourcePawn
Reply With Quote #1

Hi,

I’m very new to SourceMod scripting and I’m trying to wrap my head around some basics regarding events.

Using the examples in this tutorial http://wiki.alliedmods.net/Events_%2...d_Scripting%29 I am trying to block the item_pickup event. I’m not trying to do anything fancy, just trying to understand the difference between pre and post hooks.

Here’s my code:

PHP Code:
public OnPluginStart()
 {
              
HookEvent("item_pickup"Event_ItemPickupEventHookMode_Pre);
}
   
public 
Action:Event_ItemPickup (Handle:event, const String:name[], bool:dontBroadcast)
{
              return 
Plugin_Handled;

This doesn’t prevent me from picking up anything in CS:Source, which is what I was expecting. No doubt my lack of understanding is the problem, so I would appreciate some feedback and guidance.

Thanks.
spunkster21 is offline