View Single Post
Author Message
Netsys
Senior Member
Join Date: Feb 2010
Old 09-05-2015 , 07:34   Problem with natives, server crash
Reply With Quote #1

Steps to reproduce the crash:

1st way:
- With only natives.amxx
- Start the server
- type restart or changelevel map
- Server will crash
-

2nd way:
- With natives.amxx and nativesCall.amxx
- Start the server
-

native.sma
PHP Code:
#include <amxmodx>

native testCrash(p1 0p2[] = ""p3[] = ""p4[] = ""p5[] = ""p6[] = ""p7 0Floatp8 0.0Floatp9 0.0Floatp10 0.0Floatp11 0.0p12 0p13 0p14 0p15 0p16 0);

public 
plugin_precache()
{
    
log_to_file("native.log""[native] plugin_precache pre");
    
/* Call the native */
    
testCrash(1"param 2""param 3""param 4""param 5""param 6"080.090.0100.0110.01213141516);
    
log_to_file("native.log""[native] plugin_precache post");
}

public 
plugin_init()
{
    
log_to_file("native.log""[native] plugin_init");
    
register_plugin("native crash""1""asd");
}

public 
plugin_natives()
{
    
log_to_file("native.log""[native] plugin_natives");
    
register_native("testCrash""nativeTestCrash");
}

public 
nativeTestCrashiPluginIDiParams )
{
    
log_to_file("native.log""------------------------------");
    
log_to_file("native.log""iPluginID: %d - iParams: %d"iPluginIDiParams);
    
    for (new 
iIndex 1iIndex <= iParamsiIndex++)
    {
        switch (
iIndex)
        {
            case 
2..6:
            {
                new 
szParam[112];
                
get_string(iIndexszParamcharsmax(szParam));
                
                
log_to_file("native.log""    - Param (%d): %s"iIndexszParam);
            }
            case 
8..11:
            {
                
log_to_file("native.log""    - Param (%d): %.02f"iIndexget_param_f(iIndex));
            }
            default:
            {
                
log_to_file("native.log""    - Param (%d): %d"iIndexget_param(iIndex));
            }
        }
        
    }
    
log_to_file("native.log""------------------------------");

nativeCall.sma
PHP Code:
#include <amxmodx>

native testCrash(p1 0p2[] = ""p3[] = ""p4[] = ""p5[] = ""p6[] = ""p7 0Floatp8 0.0Floatp9 0.0Floatp10 0.0Floatp11 0.0p12 0p13 0p14 0p15 0p16 0);

public 
plugin_precache()
{
    
log_to_file("native.log""[nativeCall] plugin_precache pre");
    
testCrash(1"param 2""param 3""param 4""param 5""param 6"080.090.0100.0110.01213141516);
    
log_to_file("native.log""[nativeCall] plugin_precache post");

meta version:
PHP Code:
Metamod v1.21p37  2013/05/30 (5:13)
by Will Day
   http
://www.metamod.org/
 
PatchMetamod-(mm-pv37
 by Jussi Kivilinna
    http
://metamod-p.sourceforge.net/
compiledMay 30 201311:41:14 EET (optimized
meta list:
PHP Code:
Currently loaded plugins:
      
description      stat pend  file              vers      src   load  unlod
 
1AMX Mod X        RUN   -    amxmodx_mm.dll    v1.8.3-d  ini   Start ANY  
1 plugins
1 running 
HLDS version:
PHP Code:
Protocol version 48
Exe version 1.1.2.7 
(cstrike)
Exe build13:13:29 Aug 29 2013 (6153
AMXX Version: 1.8.3-dev+4880
Netsys is offline