Raised This Month: $ Target: $400
 0% 

Retrieving strings by using fake/dynamic natives


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
abdul-rehman
Veteran Member
Join Date: Jan 2010
Location: Khi, Pakistan
Old 06-22-2010 , 11:36   Re: Retrieving strings by using fake/dynamic natives
Reply With Quote #1

Quote:
Originally Posted by Kreation View Post
Ah, well I didn't think about that. You can try:

PHP Code:
public native_get_user_name(paramsplugin)
{
    new 
id get_param(1);
 
    static 
name[32];
    return 
get_user_name(idname31);

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_ View Post
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_nameid, const var_name[], maxlength )
{
    static 
name[32]
    
get_user_nameid name 30 )
 
    
// Copy the name into the array 
    // I think this will work !
    
copyvar_namemaxlength name)
 
    return 
1

sub-plugin will look like this:
PHP Code:
new user_name[32]
get_persons_nameiduser_namecharmaxuser_name ) ) 
__________________

My Plugins For ZP

Inactive due to College and Studies
abdul-rehman is offline
Send a message via Yahoo to abdul-rehman Send a message via Skype™ to abdul-rehman
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 14:44.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode