AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Check for spawnflags (https://forums.alliedmods.net/showthread.php?t=54353)

bwgrubbs1 04-23-2007 15:54

Check for spawnflags
 
How would I do a check here...if i want to cehck if the entity func_breakable has spawnflags set to 1 ??

Code:
#include <amxmodx> #include <fakemeta> new const PLUGIN_NAME[] = "Remove Breakable Stuff & Hostages" new const PLUGIN_AUTHOR[] = "Cheap_Suit" new const PLUGIN_VERSION[] = "1.0" public plugin_init() {     register_plugin(PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR)     register_cvar(PLUGIN_NAME, PLUGIN_VERSION, FCVAR_SPONLY|FCVAR_SERVER)     register_event("HLTV", "event_hltv", "a", "1=0", "2=0") } public event_hltv() {     remove_entity_by_classname("func_breakable")     remove_entity_by_classname("hostage_entity")     remove_entity_by_classname("scientist_entity")     remove_entity_by_classname("func_door_rotating")     remove_entity_by_classname("func_door") } stock remove_entity_by_classname(const classname[]) {     new ent = -1     while((ent = engfunc(EngFunc_FindEntityByString, ent, "classname", classname))) //I NEED TO ADD HERE TO CHECK IF spawnflags = 1 for func_breakable ?? //IF spawnflags = 1 then return...else remove entity         engfunc(EngFunc_RemoveEntity, ent) }

bwgrubbs1 04-23-2007 16:44

Re: Check for spawnflags
 
The only one I can find is in fakemeta_const and its pev_spawnflags ... how would I incorporate this. I am a newb scriptor.

teame06 04-23-2007 16:51

Re: Check for spawnflags
 
Code:
//... stock remove_entity_by_classname(const classname[]) {     new ent = -1     while((ent = engfunc(EngFunc_FindEntityByString, ent, "classname", classname)))     {         if(pev(ent, pev_spawnflags) == 1)         {             engfunc(EngFunc_RemoveEntity, ent)         }     } }

bwgrubbs1 04-23-2007 16:57

Re: Check for spawnflags
 
Other way around...if spawnflags is set to 1 do nothing...but in if is set to 0 then remove ent.

bwgrubbs1 04-23-2007 17:03

Re: Check for spawnflags
 
THANK YOU WORKS GREAT !


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

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