Raised This Month: $ Target: $400
 0% 

Event touch with not solid entity


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Frenzzy
SourceMod Donor
Join Date: Jan 2007
Location: Russia
Old 06-04-2011 , 05:26   Event touch with not solid entity
Reply With Quote #1

How can I get event when a player touches an not solid entity?


PHP Code:
// ...

new entity CreateEntityByName("flashbang_projectile");
if ((
entity != -1) && DispatchSpawn(entity))
{
    
SetEntityModel(entity"models/bigball.mdl"); // Big model
    
SetEntProp(entityProp_Send"m_CollisionGroup"2); // Set no solid
    
TeleportEntity(entityfPosNULL_VECTORNULL_VECTOR); // Teleport to player
    
SDKHook(entitySDKHook_StartTouchOnStartTouch); // Hook touch event
}

// ...

public OnStartTouch(entityclient)
{
    if (!
IsValidEntity(client))
        return;
    
    
decl String:classname[32];
    
GetEdictClassname(clientclassnamesizeof(classname));
    
    
PrintToChatAll("EntityName toched %s"classname);
    
// We need to get: "EntityName toched Player"

Frenzzy is offline
Send a message via ICQ to Frenzzy Send a message via MSN to Frenzzy Send a message via Skype™ to Frenzzy
 



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 04:20.


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