Raised This Month: $ Target: $400
 0% 

Native Problem


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Flick3rR
Veteran Member
Join Date: Feb 2014
Location: Bulgaria, Stara Zagora
Old 07-01-2014 , 16:43   Re: Native Problem
Reply With Quote #1

You can search at all. But this information helped me alot.
https://forums.alliedmods.net/showthread.php?t=41251
__________________
Flick3rR is offline
Send a message via Skype™ to Flick3rR
hornet
AMX Mod X Plugin Approver
Join Date: Mar 2010
Location: Australia
Old 07-01-2014 , 21:45   Re: Native Problem
Reply With Quote #2

Flick3rR please stop posting when you don't know the answer.

@Crizzatu

First ensure that the native is registered correctly:
PHP Code:
public plugin_natives()
{
    
register_native"get_game""native_get_game" ):

Next, you should note that strings canot be returned through natives as they can from usual stocks.
The string will be sent back and passed byref. So here's how it should look:
PHP Code:
public native_get_game(/*iPlugin, iParams*/)
{
    return 
set_string2gs_DaysListget_param)-], get_param) );

To get the name from the other plugin, you would do something like this:
PHP Code:
public SomeFunction()
{
    .
/*
        <^> For example let's get the name of day number 1.
    */
    
    
new szDay32 ];
    
get_game1szDaycharsmaxszDay ) );
    
    
/*
        <^> szDay now holds the day name.
    */
        

Make sure that you have the following inside your include file ( if you have one ), or otherwise in your plugin:

PHP Code:
native get_gameiIndexszName[], iLen ); 
__________________
Quote:
vBulletin Tip #42: Not much would be accomplished by merging this item with itself.
hornet 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 21:17.


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