Raised This Month: $51 Target: $400
 12% 

[SOLVED] Native, please check


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
hadesownage
AlliedModders Donor
Join Date: Jun 2013
Location: Romania, Iași
Old 07-26-2015 , 19:41   [SOLVED] Native, please check
Reply With Quote #1

Hello! I created natives for my plugin, but i think is incorrect.. my server go crash when i change the map..
Here is the code:
PHP Code:
public APLResAskPluginLoad2 HandlemyselfboollateStringerror [ ], err_max ) {

    
CreateNative "jail_get_user_points"NativeGetUserPoints );
    
CreateNative "jail_set_user_points"NativeSetUserPoints );
    
CreateNative "jail_check_cells"NativeCheckCells );
    
CreateNative "jail_open_cells"NativeOpenCells );
    
CreateNative "jail_check_freeday"NativeCheckFreeDay );
    
CreateNative "jail_check_day"NativeCheckDay );

    return 
APLRes_Success;
}

public 
NativeGetUserPoints HandlepluginnumParams ) {

    new 
client GetNativeCell );

    return 
_UserPoints client ];

}

public 
NativeSetUserPoints HandlepluginnumParams ) {

    new 
client GetNativeCell );
    new 
points GetNativeCell );

    
UserPoints client ] = points;
    
SaveData client );

}

public 
NativeCheckCells HandlepluginnumParams ) {

    if ( 
CellsOpened )
        return 
true;

    return 
false

}

public 
NativeOpenCells HandlepluginnumParams )
    
_OpenCells ( );

public 
NativeCheckFreeDay HandlepluginnumParams ) {

    if ( 
IsFreeDay )
        return 
true;

    return 
false;

}

public 
NativeCheckDay HandlepluginnumParams )
    return 
g_DayCode
And also in an external plugin i use like this:
native jail_set_user_points ( client, points );

In the natives is the problems ? My server go crash when i change the map.
Native works fine in external plugins!
Thank you!

Last edited by hadesownage; 07-27-2015 at 11:42. Reason: Solved.
hadesownage is offline
Send a message via Yahoo to hadesownage Send a message via Skype™ to hadesownage
KissLick
Veteran Member
Join Date: Nov 2012
Location: void
Old 07-27-2015 , 07:30   Re: Native, please check
Reply With Quote #2

This looks ok.
KissLick is offline
hadesownage
AlliedModders Donor
Join Date: Jun 2013
Location: Romania, Iași
Old 07-27-2015 , 11:42   Re: Native, please check
Reply With Quote #3

I founded the crash, thank you for you reply!
hadesownage is offline
Send a message via Yahoo to hadesownage Send a message via Skype™ to hadesownage
Benoist3012
Veteran Member
Join Date: Mar 2014
Location: CWave::ForceFinish()
Old 07-28-2015 , 07:40   Re: [SOLVED] Native, please check
Reply With Quote #4

It's possible you show to us what was wrong?
__________________
Benoist3012 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 19:33.


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