-
Notifications
You must be signed in to change notification settings - Fork 18
Tag natives
native tag_uid:tag_uid(tag_id);
Returns the universal identifier of a tag. The returned value can be used in all scripts to refer to the same tag.
native tag_id(tag_uid:tag_uid);
Returns the local identifier of a tag (i.e. the result of tagof
). A valid tag has always the highest bit set, so mask it with 0x7FFFFFFF
for comparisons. Returns 0 for invalid tags only.
native tag_name(tag_uid:tag_uid, name[], size=sizeof(name));
Returns the name of a tag, identified by its universal identifier. Returns the length of the name.
native String:tag_name_s(tag_uid:tag_uid);
Returns the name of a tag, as a dynamic string.
native tag_base(tag_uid:tag_uid);
Returns the base the tag is derived from. The name of the tag in a Pawn script specifies its base by appending @
and a subname to it.
native bool:tag_derived_from(tag_uid:tag_uid, tag_uid:base_uid);
Returns true if a specific tag is derived from another, either directly or indirectly. All tags ultimately derive from tag_uid_unknown
.
native tag_uid:tag_find(const name[]);
Attempts to find a tag by its name. Returns tag_uid_unknown
if the tag is not registered.
native tag_uid:tag_new(const name[], tag_uid:base=tag_uid_unknown);
Creates a new tag with a custom name and base. This tag will be always unique, regardless of the name, and will be accessible from all scripts via its uid. Tags cannot be deleted.
native bool:tag_set_op(tag_uid:tag_uid, tag_op:tag_op, const handler[], const additional_format[]="", AnyTag:...);
Sets a new handler to be used when an operation is dynamically performed on values with the specific tag. Only custom tags may have their operations changed (i.e. those not recognized by standard Pawn or PawnPlus). tag_op
may be any number, even one not assigned to any standard operation.
native bool:tag_set_op_expr(tag_uid:tag_uid, tag_op:tag_op, Expression:handler);
Like tag_set_op
, but uses an expression as the handler for the operation. All arguments passed to the expression have the cell type. The lifetime of the expression is prolonged until the operation is replaced.
native bool:tag_lock(tag_uid:tag_uid);
Locks a tag, preventing its operations from changes forever.
native tag_call_op(tag_uid:tag_uid, tag_op:tag_op, AnyTag:...);
Dynamically calls a tag operation on a number of values.
native tag_uid:tag_element(tag_uid:tag_uid);
Returns the tag that is referenced as an element tag of a generic tag, e.g. returns Float
for List<Float>
.