AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Godmode an ent. (https://forums.alliedmods.net/showthread.php?t=30032)

Minimum 06-20-2006 21:58

Godmode an ent.
 
Ok, I have tried everything I have thought of to godmode an ent. It still doesn't work. A little help would be nice.

Code:
#include <amxmodx> #include <amxmisc> #include <engine> #include <fakemeta> #include <fun_stocks> #define PLUGIN "Meck V3B1 Cleanup" #define VERSION "1.0" #define AUTHOR "Minimum" public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR)     set_task(5.0,"cleanup") } public cleanup() {     new ent = 0, entity = 0     while ((ent = find_ent_by_class(ent, "func_door"))) {         set_entity_flags(ent, FL_GODMODE, 1 );     }     while ((entity = find_ent_by_class(entity, "func_door_rotating"))) {         set_entity_flags(entity, FL_GODMODE, 1 );       }     set_entity_flags(120, FL_GODMODE, 1 );     server_print("Successfully Executed Cleanup.")     return PLUGIN_HANDLED }

k007 06-20-2006 22:01

what's the point of giving an ent godmode. the ent doesn't take damg.
could you explain?

Minimum 06-20-2006 22:03

Ents DO take damage. The whole point of this plugin is to stop ents from being destroyed.

v3x 06-20-2006 22:08

Code:
entity_set_int(ent , EV_INT_flags , entity_get_int(ent , EV_INT_flags) | FL_GODMODE);
I believe that's what you want.

Minimum 06-20-2006 22:08

Hmmm... I will try it out.

k007 06-20-2006 22:12

Oh yeah there is some boxes take damg lol

Spanky McNutnut 06-20-2006 22:16

Quote:

Originally Posted by k007
Oh yeah there is some boxes take damg lol

I suggest you just stop posting

Trenith Tsurgi 06-20-2006 22:35

Minimum, turn the safety back on, aha. I kind of died when Bubba shut the gunstore door on me.

Minimum 06-20-2006 22:37

Doors aren't godded. Could it be something else thats wrong with this? I breaking a func_door.

Code:
#include <amxmodx> #include <amxmisc> #include <engine> #include <fakemeta> #include <fun_stocks> #define PLUGIN "Meck V3B1 Cleanup" #define VERSION "1.0" #define AUTHOR "Minimum" public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR)     set_task(5.0,"cleanup") } public cleanup() {     new ent = 0, entity = 0     while ((ent = find_ent_by_class(ent, "func_door"))) {         entity_set_int(ent , EV_INT_flags , entity_get_int(ent , EV_INT_flags) | FL_GODMODE);     }     while ((entity = find_ent_by_class(entity, "func_door_rotating"))) {         entity_set_int(entity , EV_INT_flags , entity_get_int(entity , EV_INT_flags) | FL_GODMODE);       }     entity_set_int(120 , EV_INT_flags , entity_get_int(ent , EV_INT_flags) | FL_GODMODE);     server_print("Successfully Executed Cleanup.")     return PLUGIN_HANDLED }

GHW_Chronic 06-20-2006 22:39

Simplest way you could do this:
Code:
entity_set_float(ent,EV_FL_takedamage,0.0)


All times are GMT -4. The time now is 08:06.

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