Crashdetect on my functions file.
#1

Hi so well, I got this crashdetect debug information, after debugging my gamemode, I came up with that it's the function.script file.
Код:
[16:08:53] *** YSI Error: y_hooks attempting to redirect a PROC hook
[16:08:53] [debug] Server crashed while executing MiniGames.amx
[16:08:53] [debug] AMX backtrace:
[16:08:53] [debug] #0 faed87f1 in ?? (182604) from MiniGames.amx
[16:08:53] [debug] #1 0002e9e4 in ?? (246952) from MiniGames.amx
[16:08:53] [debug] #2 0002e6e0 in ?? (246952, 247208, 2, -27408, 1) from MiniGames.amx
[16:08:53] [debug] #3 0002e6a0 in ?? (569308, 2, 569180, 569176) from MiniGames.amx
[16:08:53] [debug] #4 0002e3c8 in ?? () from MiniGames.amx
[16:08:53] [debug] #5 000300e8 in public AMX_OnScriptInit () from MiniGames.amx
[16:08:53] [debug] #6 0000e0e0 in public Debug_OnScriptInit () from MiniGames.amx
[16:08:53] [debug] #7 00009dec in public YVers_OnScriptInit () from MiniGames.amx
[16:08:53] [debug] #8 0000965c in public ScriptInit_OnScriptInit () from MiniGames.amx
[16:08:53] [debug] #9 00009334 in public pawncmd_OnGameModeInit () from MiniGames.amx
[16:08:53] [debug] #10 00008e50 in public OnGameModeInit () from MiniGames.amx
[16:08:53] [debug] Native backtrace:
[16:08:53] [debug] #0 6c0f8c93 in ?? () from plugins\crashdetect.DLL
[16:08:53] [debug] #1 6c0f09c7 in ?? () from plugins\crashdetect.DLL
[16:08:53] [debug] #2 6c0f631a in ?? () from plugins\crashdetect.DLL
[16:08:53] [debug] #3 6b874509 in ?? () from plugins\streamer.DLL
[16:08:53] [debug] #4 0046f654 in ?? () from samp-server.exe
[16:08:53] [debug] #5 65646f6d in ?? () from samp-server.exe
[16:08:53] [debug] #6 694d2f73 in ?? () from samp-server.exe
[16:08:53] [debug] #7 6147696e in ?? () from samp-server.exe
[16:08:53] [debug] #8 023fd3c8 in ?? ()
After I see this code, it immediatly shut down.

The functions.script file contains;
PHP код:
stock Log(input[]) {
    new 
File:handle fopen("server.log"io_append);
    if(
handle) {
        new 
inputEx[128];
        
format(inputEx128"%s\r\n"input);
        
fwrite(handleinputEx);
        
fclose(handle);
    }
}
//////////////////////////////////////////////////////////
stock MG_GetPlayerName(playerid) {
    new 
MG_Name[24+1];
    
GetPlayerName(playeridMG_Name24+1);
    return 
MG_Name;
}
#if defined _ALS_GetPlayerName
    #undef GetPlayerName
#else
    #define _ALS_GetPlayerName
#endif
#define GetPlayerName MG_GetPlayerName
//////////////////////////////////////////////////////////
stock MG_Kick(playerididk 0) {
    if(
idk)
        
Kick(playerid);
    else
        
SetTimerEx("KickPlayer"1000false"i"playerid);
    return 
1;
}
#if defined _ALS_Kick
    #undef Kick
#else
    #define _ALS_Kick
#endif
#define Kick MG_Kick
forward KickPlayer(playerid);
public 
KickPlayer(playerid)
    
Kick(playerid1);
//////////////////////////////////////////////////////////
stock MG_strcmp(const string1[], const string2[], bool:ignorecase=falselength=cellmax) {
    if(!
isnull(string1) || !isnull(string2))
        return 
0;
    else
        return 
strcmp(string1string2ignorecaselength);
}
#if defined _ALS_strcmp
    #undef strcmp
#else
    #define _ALS_strcmp
#endif
#define strcmp MG_strcmp 
The files for my gamemode are the following;
PHP код:
/*
 __  ____       _   _____
|  \/  (_)     (_) |  __ \
| .  . |_ _ __  _  | |  \/ __ _ _ __ ___   ___ ___
| |\/| | | '_ \| | | | __ / _` | '_ ` _ \ / _ / __|
| |  | | | | | | | | |_\ | (_| | | | | | |  __\__ \
\_|  |_|_|_| |_|_|  \____/\__,_|_| |_| |_|\___|___/
              _____                                          _
             |  __ \                                        | |
             | |  \/ __ _ _ __ ___   ___ _ __ ___   ___   __| | ___
             | | __ / _` | '_ ` _ \ / _ | '_ ` _ \ / _ \ / _` |/ _ \
             | |_\ | (_| | | | | | |  __| | | | | | (_) | (_| |  __/
              \____/\__,_|_| |_| |_|\___|_| |_| |_|\___/ \__,_|\___|
 _
| |
| |__  _   _
| '_ \| | | |
| |_) | |_| |
|_.__/ \__, |
        __/ |
       |___/
             __       _
           / / _   _(_) ___ _   _
          / / | | | | |/ __| | | |
         / /__| |_| | | (__| |_| |
         \____/\__,_|_|\___|\__, |
                            |___/
*/
#include <a_samp>
#include <easy-mysql>
#include <Pawn.CMD>
#define         COL_TITLE       "{90C3D4}"
#define         COLOR_TITLE     0x90C3D4FF
#define         COL_DEFAULT     "{D1D1D1}"
#define         COLOR_DEFAULT   0xD1D1D1FF
#define         COLOR_ERROR     0xFF8080FF
#define         COL_ERROR         "{FF8080}"
#define         COL_NOTICE      "{90C3D4}"
#define         COLOR_NOTICE    0x90C3D4FF
#define         DIALOG_ID_LOGIN         1
#define         DIALOG_ID_REGISTER      2
#define         DIALOG_ID_NOTICE        3
main(){}
#include "..\MiniGames\functions.script"
//#include "..\MiniGames\database.script" // removed for debug
//#include "..\MiniGames\server.script" // removed for debug
//#include "..\MiniGames\players.script" // removed for debug
//#include "..\MiniGames\game.script" // removed for debug
//#include "..\MiniGames\admin.script" // removed for debug 
Reply
#2

Fixed using this code;
PHP код:
stock Log(input[]) {
    new 
File:handle fopen("server.log"io_append);
    if(
handle) {
        new 
inputEx[128];
        
format(inputEx128"%s\r\n"input);
        
fwrite(handleinputEx);
        
fclose(handle);
    }
}
//////////////////////////////////////////////////////////
stock MG_GetPlayerName(playerid) {
    new 
MG_Name[24+1];
    
GetPlayerName(playeridMG_Name24+1);
    return 
MG_Name;
}
/*#if defined _ALS_GetPlayerName
    #undef GetPlayerName
#else
    #define _ALS_GetPlayerName
#endif*/
#define GetPlayerName(%0) MG_GetPlayerName(%0)
//////////////////////////////////////////////////////////
stock MG_Kick(playerididk 0) {
    if(
idk)
        
Kick(playerid);
    else
        
SetTimerEx("KickPlayer"1000false"i"playerid);
    return 
1;
}
/*#if defined _ALS_Kick
    #undef Kick
#else
    #define _ALS_Kick
#endif*/
#define Kick(%0) MG_Kick(%0)
forward KickPlayer(playerid);
public 
KickPlayer(playerid)
    
MG_Kick(playerid1);
//////////////////////////////////////////////////////////
/*stock MG_strcmp(const string1[], const string2[], bool:ignorecase=false, length=cellmax) {
    if(!isnull(string1) || !isnull(string2))
        return 0;
    else
        return strcmp(string1, string2, ignorecase, length);
}
#if defined _ALS_strcmp
    #undef strcmp
#else
    #define _ALS_strcmp
#endif
#define strcmp MG_strcmp*/ 
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)