AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Get Notarget Mode? (https://forums.alliedmods.net/showthread.php?t=60389)

Silencer123 09-02-2007 14:02

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

(Notarget Mode disables Monsters attacking Players)

VEN 09-04-2007 11:43

Re: Get Notarget Mode?
 
set_pev(victim, pev_flags, pev(victim, pev_flags) | FL_NOTARGET) should work.

Silencer123 09-04-2007 12:46

Re: Get Notarget Mode?
 
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.

Silencer123 09-06-2007 15:22

Re: Get Notarget Mode?
 
Noone? Come on VEN! I know you know it! You know everything you know. :p

VEN 09-08-2007 09:20

Re: Get Notarget Mode?
 
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.


All times are GMT -4. The time now is 16:04.

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