Raised This Month: $ Target: $400
 0% 

register_native, return text.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
xbatista
Veteran Member
Join Date: Mar 2008
Location: Lithuania
Old 05-19-2009 , 13:23   register_native, return text.
Reply With Quote #1

I know I return bad,cuz it returns not a value, so how to return it as a text/text message by playersh[id]?
Cuz I need to put it in another plugin ,something like this :
Second plugin :
PHP Code:
    pos += format(szMotd[pos], 2047-pos"RankShit : %s<br><br>"get_user_sh(id)) 
Include file:
PHP Code:
native get_user_sh(id
First plugin :
PHP Code:
#define MAXSHIT 2

new const RANKSHIT[MAXSHIT][] = { "bull.....""cow....."}

new 
playersh[33];
public 
plugin_natives()
{
    
register_native("get_user_sh""native_get_user_sh"1);

PHP Code:
// Native: return text
public native_get_user_sh(id)
{
    return 
RANKSHIT[playersh[id]];


Last edited by xbatista; 05-19-2009 at 13:30.
xbatista is offline
Send a message via Skype™ to xbatista
Emp`
AMX Mod X Plugin Approver
Join Date: Aug 2005
Location: Decapod 10
Old 05-19-2009 , 14:03   Re: register_native, return text.
Reply With Quote #2

IIRC you cannot do that with natives. You will have to use:
Code:
// Sets a string in the calling plugin
native set_string(param, dest[], maxlen);
Emp` is offline
Send a message via AIM to Emp` Send a message via MSN to Emp` Send a message via Yahoo to Emp` Send a message via Skype™ to Emp`
xbatista
Veteran Member
Join Date: Mar 2008
Location: Lithuania
Old 05-19-2009 , 14:08   Re: register_native, return text.
Reply With Quote #3

Omg I don't know how to use it :/
Show me please an example of that code what I gave
xbatista is offline
Send a message via Skype™ to xbatista
Old 05-19-2009, 14:13
xbatista
This message has been deleted by xbatista. Reason: sorry double post,site lags
Emp`
AMX Mod X Plugin Approver
Join Date: Aug 2005
Location: Decapod 10
Old 05-19-2009 , 16:01   Re: register_native, return text.
Reply With Quote #5

Code:
public native_get_user_sh(id, string[], len)
{
    return set_string(2, RANKSHIT[playersh[id]], len);
}
You might be able to just do:
Code:
public native_get_user_sh(id, string[], len)
{
    return copy(string, len, RANKSHIT[playersh[id]]);
}
I'm not really sure with mode 1 with fakenatives.

You'll also have to use
Code:
native get_user_sh(id, string[], len)
In your include file.
Emp` is offline
Send a message via AIM to Emp` Send a message via MSN to Emp` Send a message via Yahoo to Emp` Send a message via Skype™ to Emp`
xbatista
Veteran Member
Join Date: Mar 2008
Location: Lithuania
Old 05-19-2009 , 16:37   Re: register_native, return text.
Reply With Quote #6

Ok thanks ,will try tommorow ,will give feedback, going to sleep :0
xbatista is offline
Send a message via Skype™ to xbatista
xbatista
Veteran Member
Join Date: Mar 2008
Location: Lithuania
Old 05-20-2009 , 00:28   Re: register_native, return text.
Reply With Quote #7

How to use than this in MOTD/show text?

new str[5];
get_user_sh(id, str, 4) ?

Last edited by xbatista; 05-20-2009 at 00:37.
xbatista is offline
Send a message via Skype™ to xbatista
xbatista
Veteran Member
Join Date: Mar 2008
Location: Lithuania
Old 05-21-2009 , 10:02   Re: register_native, return text.
Reply With Quote #8

Someone,please? :/
xbatista is offline
Send a message via Skype™ to xbatista
xbatista
Veteran Member
Join Date: Mar 2008
Location: Lithuania
Old 06-02-2009 , 12:17   Re: register_native, return text.
Reply With Quote #9

Please?
xbatista is offline
Send a message via Skype™ to xbatista
hleV
Veteran Member
Join Date: Mar 2007
Location: Lithuania
Old 06-02-2009 , 12:54   Re: register_native, return text.
Reply With Quote #10

Don't bump your thread unless it's been 2 weeks after the last post.
__________________
hleV is offline
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 01:24.


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