View Single Post
Author Message
Peace-Maker
SourceMod Plugin Approver
Join Date: Aug 2008
Location: Germany
Old 03-17-2011 , 19:43   trigger_multiple trigger for weapons?
Reply With Quote #1

I'm creating a trigger_multiple with spawnflags set to 64:

PHP Code:
new iEnt CreateEntityByName("trigger_multiple");
DispatchKeyValue(iEnt"spawnflags""64");
DispatchKeyValue(iEnt"wait""1");
DispatchSpawn(iEnt);
ActivateEntity(iEnt);
HookSingleEntityOutput(iEnt"OnStartTouch"EntOut_OnStartTouch);
// ... teleport set max/min 
Now in the output callback i just print out the classname of the entity touching:
PHP Code:
public EntOut_OnStartTouch(const String:output[], calleractivatorFloat:delay)
{
    
decl String:sClassName[64];
    if(
IsValidEntity(activator)
    && 
IsValidEdict(activator)
    && 
GetEdictClassname(activatorsClassNamesizeof(sClassName))
    
//&& StrContains(sClassName, "weapon_") != -1
    //&& GetEntPropEnt(activator, Prop_Send, "m_hOwnerEntity") == -1)
    
)
    {
        
PrintToChatAll("Touched by: %s"sClassName);
        
//RemoveEdict(activator);
    
}

When running through the trigger, it displays "Touched by: player" correctly, but when dropping my weapon into it, it just doesn't do anything at all. Is there something i'm missing? Wrong spawnflags?
__________________
Peace-Maker is offline