plugins/include/entity.inc
changeset 3231 2dd827f75426
parent 2337 12cb4b88e130
child 3293 f688cf4a4201
     1.1 --- a/plugins/include/entity.inc	Thu Apr 07 23:03:51 2011 -0400
     1.2 +++ b/plugins/include/entity.inc	Sat Apr 09 00:29:46 2011 -0400
     1.3 @@ -163,6 +163,21 @@
     1.4  native bool:GetEdictClassname(edict, String:clsname[], maxlength);
     1.5  
     1.6  /**
     1.7 + * Retrieves the classname of an entity.
     1.8 + * This is like GetEdictClassname(), except it works for ALL
     1.9 + * entities, not just edicts.
    1.10 + *
    1.11 + * @param edict			Index of the entity.
    1.12 + * @param clsname		Buffer to store the classname.
    1.13 + * @param maxlength		Maximum length of the buffer.
    1.14 + * @return				True on success, false if there is no classname set.
    1.15 + */
    1.16 +stock bool:GetEntityClassname(entity, String:clsname[], maxlength)
    1.17 +{
    1.18 +	return !!GetEntPropString(entity, Prop_Data, "m_iClassname", clsname, maxlength);
    1.19 +}
    1.20 +
    1.21 +/**
    1.22   * Retrieves an entity's networkable serverclass name.
    1.23   * This is not the same as the classname and is used for networkable state changes.
    1.24   *