Raised This Month: $32 Target: $400
 8% 

[RESOLVED] Use Entities in Code


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
mysticssjgoku4
Veteran Member
Join Date: Jan 2005
Location: Chicago Heights, IL
Old 06-05-2011 , 13:56   [RESOLVED] Use Entities in Code
Reply With Quote #1

I want to invoke an entity not by player, but by activation through code. Somehow invoke a door, or button.
I tried, ActivateEntity to no avail.
http://docs.sourcemod.net/api/index....d=show&id=675&

Thanks
__________________


Last edited by mysticssjgoku4; 06-05-2011 at 14:53.
mysticssjgoku4 is offline
Send a message via AIM to mysticssjgoku4 Send a message via MSN to mysticssjgoku4
pheadxdll
AlliedModders Donor
Join Date: Jun 2008
Old 06-05-2011 , 14:02   Re: Use Entities in Code
Reply With Quote #2

Let's see some code
__________________
pheadxdll is offline
mysticssjgoku4
Veteran Member
Join Date: Jan 2005
Location: Chicago Heights, IL
Old 06-05-2011 , 14:35   Re: Use Entities in Code
Reply With Quote #3

Code:
public OnClientPutInServer(id) {     SDKHook(id, SDKHook_StartTouch, Start_Touch); } //Toucher/Touched object //Toucher should always be player.. public Action:Start_Touch(e1, e2) {     decl String:tn2[128];        decl String:cn2[128];         GetEdictClassname(e2, cn2, sizeof(cn2));     GetEntPropString(e2, Prop_Data, "m_iName", tn2, sizeof(tn2));         if(StrEqual(cn2,"func_door",false) || StrEqual(cn2,"func_door_rotating",false))     {         PrintToChatAll("(%s/%s)",cn2,tn2);         ActivateEntity(e2);     } }
__________________

mysticssjgoku4 is offline
Send a message via AIM to mysticssjgoku4 Send a message via MSN to mysticssjgoku4
pheadxdll
AlliedModders Donor
Join Date: Jun 2008
Old 06-05-2011 , 14:41   Re: Use Entities in Code
Reply With Quote #4

Ah, you wanna do AcceptEntityInput(iDoor, "Open");

For reference check out the VDC page on func_door: http://developer.valvesoftware.com/wiki/Func_door You can trigger any of the inputs with that function or any of the keyvalues with DispatchKeyValue.
__________________
pheadxdll is offline
mysticssjgoku4
Veteran Member
Join Date: Jan 2005
Location: Chicago Heights, IL
Old 06-05-2011 , 14:53   Re: Use Entities in Code
Reply With Quote #5

I think I will make sweet love you now. Thank you =)
__________________

mysticssjgoku4 is offline
Send a message via AIM to mysticssjgoku4 Send a message via MSN to mysticssjgoku4
Reply



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 06:28.


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