Quote:
Originally Posted by Kreation
Ah, well I didn't think about that. You can try:
PHP Code:
public native_get_user_name(params, plugin) { new id = get_param(1); static name[32]; return get_user_name(id, name, 31); }
I'm not sure if that will work or not.
I think this might be an off day for me.
|
It will not work bcoz you cant return arrays in natives
Quote:
Originally Posted by wrecked_
You can't return an array. Follow the Plugin API and Fake Native tutorials by Hawk to learn about array packing in natives.
|
Hawk's tutorials are always confusing and incomplete....

i read the natives tutorial but regarding my question nothing is covered there so i came up with another idea:
PHP Code:
public native_get_persons_name( id, const var_name[], maxlength )
{
static name[32]
get_user_name( id , name , 30 )
// Copy the name into the array
// I think this will work !
copy( var_name, maxlength , name)
return 1
}
sub-plugin will look like this:
PHP Code:
new user_name[32]
get_persons_name( id, user_name, charmax( user_name ) )
__________________