Raised This Month: $ Target: $400
 0% 

Problem to return string from nativ


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
kostov
Member
Join Date: Jan 2010
Location: Bulgaria, Sofia
Old 06-28-2012 , 15:34   Problem to return string from nativ
Reply With Quote #1

Hi,

How can I return a string?

PHP Code:
public plugin_init()
{
    
register_cvar("amx_mode_prefix""[Test]");
}

public 
plugin_natives()
{
    
register_native("get_server_prefix""native_get_server_prefix"1);
}

public 
native_get_server_prefix()
{
    new 
iPrefix[64]; 
    
get_cvar_string("amx_mode_prefix"iPrefixsizeof iPrefix 1);
    return 
iPrefix;

PHP Code:
client_print(idprint_chat"%s test messages"get_server_prefix()); 
This does not work when trying to use the function earns error in console.

With what I saw, PAWN can not make a return string, only values?
kostov is offline
 



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 06:18.


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