Raised This Month: $ Target: $400
 0% 

+Use to open door


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 01-23-2007 , 21:18   Re: +Use to open door
Reply With Quote #1

Quote:
Originally Posted by stupok69 View Post
Change to the line below. When you put 200 in there, the only time the door will open is if the client is exactly 200 units away from the door. If you want to open the door only when the client is within 200 units of the door, check the distance between the client and door with get_distance.
Disregard this comment, it's wrong.

Quote:
Originally Posted by stupok69 View Post
I don't actually know for sure if this function is case sensitive, but I always right it like this:
Code:
public client_PreThink


Other than that , it looks ok. I don't know if fake_touch is necessary. You can omit the return inside of the if.
"Right" is inappropriate in this context.

Also, if that doesn't work, try changing the fake_touch/force_use block to this:

Code:
force_use(entid,entid) fake_touch(entid,entid)
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
Old 01-23-2007, 21:38
commonbullet
This message has been deleted by commonbullet. Reason: misunderstanding
blackops7799
Senior Member
Join Date: May 2006
Old 01-23-2007 , 21:53   Re: +Use to open door
Reply With Quote #3

well its working, but Im getting spammed in my console and it is also freezing alot.

Code:
L 01/23/2007 - 21:03:06: [ENGINE] Invalid player 0 (not in-game)
L 01/23/2007 - 21:03:06: [AMXX] Displaying debug trace (plugin "doormod.amxx")
L 01/23/2007 - 21:03:06: [AMXX] Run time error 10: native error (native "force_use")
L 01/23/2007 - 21:03:06: [AMXX]    [0] doormod.sma::client_PreThink (line 15)

Code:
#include <amxmodx> #include <amxmisc> #include <engine> public plugin_init() {     register_plugin("Door Mod", "1", "Jake") } public client_PreThink(id) {     new entbody, entid     get_user_aiming(id,entid,entbody,200)     if(entity_get_int(id,EV_INT_button) & IN_USE && !(entity_get_int(id,EV_INT_oldbuttons) & IN_USE))     {         force_use(id,entid)         fake_touch(entid,id)         return PLUGIN_CONTINUE     }     return PLUGIN_CONTINUE }
blackops7799 is offline
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 01-23-2007 , 22:33   Re: +Use to open door
Reply With Quote #4

Try changing it to the thing I said before.
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
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 22:24.


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