method_get_self

With this function you can retrieve the instance ID or struct reference which is the self context used when the method is called. If the variable is not a method then the function will return undefined. Please note that the function may also return the constant pointer_null, in which case the current self is being used at the time of the call.

 

Syntax:

method_get_self(method);

Argument Description
method The method variable to check.

 

Returns:

Integer, undefined, pointer_null

 

Example:

var _self = method_get_self(light_properties);
show_debug_message(string(_self));

The above code gets the self context for the given method variable and outputs it to the console.