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

[EXTENSION] Hooker


Post New Thread Reply   
 
Thread Tools Display Modes
Fredd
Veteran Member
Join Date: Jul 2007
Old 05-19-2008 , 22:18   Re: [EXTENSION] Hooker *BETA
Reply With Quote #21

paste your script...you should try "prop_physics_multiplayer" im 100% that works because thats what all of the maps in css use and i tested it in d2 and d1
__________________
Need a private coder? AMXX, SourceMOD, MMS? PM me!
Fredd is offline
raydan
Senior Member
Join Date: Aug 2006
Old 05-19-2008 , 23:10   Re: [EXTENSION] Hooker *BETA
Reply With Quote #22

Code:
#pragma semicolon 1
#include <sdktools>
#include <sourcemod>
#include <hooker>
 
public Plugin:myinfo = 
{
    name = "raydan",
    author = "raydan",
    description = "raydan",
    version = "1.0",
    url = "http://www"
};
public OnPluginStart()
{
 RegisterHook(HK_Touch, EntityTouchFunction, true);
 RegConsoleCmd("prop", create_prop);
}
public Action:EntityTouchFunction(ent, touched)
{
 PrintToServer("ent %d touch %d",ent,touched);
}
public Action:create_prop(client,args)
{
 decl ent;
 decl Float:vAngles[3], Float:vOrigin[3],Float:vec[3];
 ent = CreateEntityByName("prop_physics_multiplayer");
 if(IsValidEntity(ent))
 {
  DispatchKeyValue(ent,"model","models/props_junk/watermelon01.mdl");
  DispatchSpawn(ent);
  
  GetClientEyePosition(client,vOrigin);
  GetClientEyeAngles(client,vAngles);
  GetAngleVectors(vAngles,vec,NULL_VECTOR,NULL_VECTOR);
  NormalizeVector(vec,vec);
  ScaleVector(vec,GetRandomFloat(600.0,800.0));
  TeleportEntity(ent, vOrigin,vAngles,vec);
  AddHooksToEntity(ent);
  PrintToServer("%d prop created",ent);
 }
}
it will create a watermelon.
function will run, if watermelon touch on the ground(70% run the code).
watermelon touch the wall, code never be run
raydan is offline
Fredd
Veteran Member
Join Date: Jul 2007
Old 05-19-2008 , 23:15   Re: [EXTENSION] Hooker *BETA
Reply With Quote #23

well the thing is the ground and walls are just 1 entity which is world spawn most entites touch functions dont tend to get called when they worldspawn afaik but it was like a "func_wall" then im sure it will get called...i will try the code on my server and see what actually happens in game..
__________________
Need a private coder? AMXX, SourceMOD, MMS? PM me!
Fredd is offline
Fredd
Veteran Member
Join Date: Jul 2007
Old 05-19-2008 , 23:41   Re: [EXTENSION] Hooker *BETA
Reply With Quote #24

i little your script a little and this is what i ended up with
Code:
public OnPluginStart() {     RegisterHook(HK_Touch, OnTouch, false);     RegConsoleCmd("prop", create_prop); } public Action:create_prop(client,args) {     decl ent;     decl Float:vAngles[3], Float:vOrigin[3],Float:vec[3];     ent = CreateEntityByName("prop_physics_multiplayer");     if(IsValidEntity(ent))     {         DispatchKeyValue(ent,"model","models/props_junk/watermelon01.mdl");         DispatchSpawn(ent);                 GetClientEyePosition(client,vOrigin);         GetClientEyeAngles(client,vAngles);         GetAngleVectors(vAngles,vec,NULL_VECTOR,NULL_VECTOR);         NormalizeVector(vec,vec);         ScaleVector(vec,GetRandomFloat(600.0,800.0));         TeleportEntity(ent, vOrigin,vAngles,vec);         AddHooksToEntity(ent);         PrintToServer("%d prop created",ent);     } } public Action:OnTouch(toucher, touched) {     decl String:cls[64];     GetEdictClassname(toucher, cls, sizeof(cls));     if(StrEqual(cls, "prop_physics_multiplayer"))     {         decl String:touchedcls[64];         GetEdictClassname(touched, touchedcls, sizeof(touchedcls));         PrintToChatAll("toucher %s touched %s", cls, touchedcls);     } }
now touch actually works fine, the touch wont get called touching world spawn but it gets called when touching other entities such as prop_physics_multiplayer and even brushed entites such as func_bomb_target and func_buyzone so i can't really help you with figuring out how to find out when it touches a wall...because this is how the game works prop_physics_multiplayer's touch functions dont get called when they touch world...
__________________
Need a private coder? AMXX, SourceMOD, MMS? PM me!
Fredd is offline
raydan
Senior Member
Join Date: Aug 2006
Old 05-19-2008 , 23:46   Re: [EXTENSION] Hooker *BETA
Reply With Quote #25

no way to call it when touch the wall?
raydan is offline
Fredd
Veteran Member
Join Date: Jul 2007
Old 05-19-2008 , 23:49   Re: [EXTENSION] Hooker *BETA
Reply With Quote #26

nope as i said, if its a brushed wall that is tied to "world" then it wont be called but if it was like a "func_wall" it should be called..
__________________
Need a private coder? AMXX, SourceMOD, MMS? PM me!
Fredd is offline
FLOOR_MASTER
Senior Member
Join Date: Mar 2008
Old 05-20-2008 , 08:13   Re: [EXTENSION] Hooker *BETA
Reply With Quote #27

Wow -- great work! I'm really looking forward to when HK_OnTakeDamage works properly in TF2 in pre mode!
FLOOR_MASTER is offline
raydan
Senior Member
Join Date: Aug 2006
Old 05-20-2008 , 11:18   Re: [EXTENSION] Hooker *BETA
Reply With Quote #28

Quote:
Originally Posted by Fredd View Post
nope as i said, if its a brushed wall that is tied to "world" then it wont be called but if it was like a "func_wall" it should be called..
plugin writer don't know all wall in a map is "func_wall" or not. it is a map maker problem.

by the way, i can fix it now
raydan is offline
Fredd
Veteran Member
Join Date: Jul 2007
Old 05-20-2008 , 11:27   Re: [EXTENSION] Hooker *BETA
Reply With Quote #29

Quote:
Originally Posted by raydan View Post
plugin writer don't know all wall in a map is "func_wall" or not. it is a map maker problem.

by the way, i can fix it now
what was your fix?
__________________
Need a private coder? AMXX, SourceMOD, MMS? PM me!
Fredd is offline
raydan
Senior Member
Join Date: Aug 2006
Old 05-20-2008 , 22:48   Re: [EXTENSION] Hooker *BETA
Reply With Quote #30

Quote:
Originally Posted by Fredd View Post
what was your fix?
use another entity, same as missile
raydan is offline
Reply


Thread Tools
Display Modes

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 15:53.


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