Raised This Month: $ Target: $400
 0% 

Get Notarget Mode?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Silencer123
Veteran Member
Join Date: Jul 2006
Old 09-02-2007 , 14:02   Get Notarget Mode?
Reply With Quote #1

I am missing a get_user_notarget function or similar.
Anyone knows where I can find such function?

(Notarget Mode disables Monsters attacking Players)
__________________
EAT YOUR VEGGIES
Silencer123 is offline
VEN
Veteran Member
Join Date: Jan 2005
Old 09-04-2007 , 11:43   Re: Get Notarget Mode?
Reply With Quote #2

set_pev(victim, pev_flags, pev(victim, pev_flags) | FL_NOTARGET) should work.
VEN is offline
Silencer123
Veteran Member
Join Date: Jul 2006
Old 09-04-2007 , 12:46   Re: Get Notarget Mode?
Reply With Quote #3

Thanks I'll try.
EDIT: It works! Not that that surprises me. VEN is always correct. ;p
Another question: How to activate fly mode? I tried FL_FLY and FL_FLOAT
instead of FL_NOTARGET but that one did not work. Not even if combined
with noclip mode.
__________________
EAT YOUR VEGGIES

Last edited by Silencer123; 09-04-2007 at 13:28.
Silencer123 is offline
Silencer123
Veteran Member
Join Date: Jul 2006
Old 09-06-2007 , 15:22   Re: Get Notarget Mode?
Reply With Quote #4

Noone? Come on VEN! I know you know it! You know everything you know. :p
__________________
EAT YOUR VEGGIES
Silencer123 is offline
VEN
Veteran Member
Join Date: Jan 2005
Old 09-08-2007 , 09:20   Re: Get Notarget Mode?
Reply With Quote #5

Unfortunately set_pev(id, pev_movetype, MOVETYPE_FLY) will not work for some reason so i can offer quite ugly workaround.
Code:
#include <amxmodx> #include <fakemeta> public plugin_init() {         register_clcmd("test", "func") } public func(id) {         static funcid0, funcid1         if (funcid0) {                 unregister_forward(FM_PlayerPreThink, funcid0, 0)                 unregister_forward(FM_PlayerPreThink, funcid1, 1)                 set_pev(id, pev_movetype, MOVETYPE_WALK)         }         else {                 funcid0 = register_forward(FM_PlayerPreThink, "PlayerPreThink", 0)                 funcid1 = register_forward(FM_PlayerPreThink, "PlayerPreThink", 1)                 set_pev(id, pev_movetype, MOVETYPE_NOCLIP)         }         return PLUGIN_HANDLED } public PlayerPreThink(id) {         static Float:origin[3], Float:origin2[3]         origin2 = origin         pev(id, pev_origin, origin)         engfunc(EngFunc_TraceHull, origin, origin, DONT_IGNORE_MONSTERS, HULL_HUMAN, id, 0)         if (!(!get_tr2(0, TR_StartSolid) && !get_tr2(0, TR_AllSolid) && get_tr2(0, TR_InOpen)))                 engfunc(EngFunc_SetOrigin, id, origin2) }
It will allow to fly without noclip effect but in turn it will effect in twitching/blocking of player while in touch.

Last edited by VEN; 09-08-2007 at 09:27.
VEN 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 16:04.


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