Raised This Month: $ Target: $400
 0% 

Check for spawnflags


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
bwgrubbs1
Senior Member
Join Date: Sep 2006
Old 04-23-2007 , 15:54   Check for spawnflags
Reply With Quote #1

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 is offline
bwgrubbs1
Senior Member
Join Date: Sep 2006
Old 04-23-2007 , 16:44   Re: Check for spawnflags
Reply With Quote #2

The only one I can find is in fakemeta_const and its pev_spawnflags ... how would I incorporate this. I am a newb scriptor.
bwgrubbs1 is offline
teame06
i have a hat
Join Date: Feb 2005
Location: Hat City
Old 04-23-2007 , 16:51   Re: Check for spawnflags
Reply With Quote #3

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)         }     } }
__________________
No private support via Instant Message
GunGame:SM Released
teame06 is offline
Send a message via AIM to teame06
bwgrubbs1
Senior Member
Join Date: Sep 2006
Old 04-23-2007 , 16:57   Re: Check for spawnflags
Reply With Quote #4

Other way around...if spawnflags is set to 1 do nothing...but in if is set to 0 then remove ent.
bwgrubbs1 is offline
bwgrubbs1
Senior Member
Join Date: Sep 2006
Old 04-23-2007 , 17:03   Re: Check for spawnflags
Reply With Quote #5

THANK YOU WORKS GREAT !
bwgrubbs1 is offline
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 06:44.


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