How do I change an entity's flags?
I need to change the flags on a player's sentry gun so that it cannot be upgraded. I've found the function to set and get entity flags, and I've figured out how to get the index of the sentry gun, but I don't understand how to use the SetEntityFlags function. Here's the Sourcemod API page for the function: https://sm.alliedmods.net/new-api/en...SetEntityFlags
Here's the entity page for the sentry: https://developer.valvesoftware.com/wiki/Obj_sentrygun I want to either remove or disable the "upgradable" flag. What do I enter for the second argument on the "SetEntityFlags(entity, flags)" function to make this happen? |
Re: How do I change an entity's flags?
my guess:
PHP Code:
|
Re: How do I change an entity's flags?
Quote:
|
Re: How do I change an entity's flags?
Quote:
|
Re: How do I change an entity's flags?
Quote:
SetEntProp(ent, bool, "m_spawnflags_upgradable", false, 4, 0); I should probably mention that ent is the name of an int I'm using to store the index of the sentry. |
Re: How do I change an entity's flags?
Quote:
|
Re: How do I change an entity's flags?
SetEntProp(ent, Prop_Data, "m_spawnflags_upgradable", 0)
|
Re: How do I change an entity's flags?
Quote:
|
Re: How do I change an entity's flags?
SetEntProp can affect any netprop.
SetEntityFlags only affects whatever stores the entity's flags, not its spawnflags. Spawnflags are different than entity flags. |
Re: How do I change an entity's flags?
dunno why I wrote that, you probably want SetEntProp(ent, Prop_Data, "m_spawnflags", 0) instead
|
All times are GMT -4. The time now is 17:21. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.