01.04.2016, 07:54
Here Is The Error I Received While using Crash-detect Plugins
Explain Me In Detail To Fix It.
Here Is Mine OnGameModeInit
Код:
[09:51:25] function 'mysql_debug' is deprecated, use 'mysql_log' instead. [09:51:25] function 'mysql_debug' is deprecated, use 'mysql_log' instead. [09:51:25] [MYSQL]: Connection To `port_2556` Successful! [09:51:25] [debug] Server crashed while executing cnr.amx [09:51:25] [debug] AMX backtrace: [09:51:25] [debug] #0 native mysql_query () from mysql.so [09:51:25] [debug] #1 00012674 in public OnGameModeInit () from cnr.amx [09:51:25] [debug] Native backtrace: [09:51:25] [debug] #0 b74d3e8b in _ZN10StackTraceC1EPv () from plugins/crashdetect.so [09:51:25] [debug] #1 b74ccbcf in _ZN11CrashDetect20PrintNativeBacktraceERSoPv () from plugins/crashdetect.so [09:51:25] [debug] #2 b74cddbc in _ZN11CrashDetect20PrintNativeBacktraceEPv () from plugins/crashdetect.so [09:51:25] [debug] #3 b74ce226 in _ZN11CrashDetect11OnExceptionEPv () from plugins/crashdetect.so [09:51:25] [debug] #4 b74d3adc in ?? () from plugins/crashdetect.so [09:51:25] [debug] #5 b77b140c in ?? () [09:51:25] [debug] #6 b6a29aec in _Z5ErrorP5MySQLPKci () from plugins/mysql.so [09:51:25] [debug] #7 b6a2daab in _ZN7Natives13n_mysql_queryEP6tagAMXPi () from plugins/mysql.so [09:51:25] [debug] #8 080950e4 in ?? () from ./sampsvr-port_2556 [09:51:25] [debug] #9 b74cf94b in _ZN11CrashDetect13DoAmxCallbackEiPiS0_ () from plugins/crashdetect.so [09:51:25] [debug] #10 b74d28f8 in ?? () from plugins/crashdetect.so [09:51:25] [debug] #11 b74d6916 in amx_Exec () from plugins/crashdetect.so [09:51:25] [debug] #12 b74cebe6 in _ZN11CrashDetect9DoAmxExecEPii () from plugins/crashdetect.so [09:51:25] [debug] #13 b74d2659 in ?? () from plugins/crashdetect.so [09:51:25] [debug] #14 080a503b in ?? () from ./sampsvr-port_2556 [09:51:25] [debug] #15 080ab922 in ?? () from ./sampsvr-port_2556 [09:51:25] [debug] #16 080aa0fd in ?? () from ./sampsvr-port_2556 [09:51:25] [debug] #17 b750ee66 in __libc_start_main () from /lib/i386-linux-gnu/i686/cmov/libc.so.6 [09:51:25] [debug] #18 0804b4e1 in ?? () from ./sampsvr-port_2556
Here Is Mine OnGameModeInit
Код:
public OnGameModeInit() { mysql_debug(1); new string[256]; SetGameModeText("Cops And Robbers"); ShowNameTags(1); ShowPlayerMarkers(1); EnableStuntBonusForAll(0); AllowInteriorWeapons(1); //SetWeather(1); //SetGravity(0.008); //UsePlayerPedAnims(); // Will cause the players to use CJ running/walking animations DisableInteriorEnterExits(); // will disable all interior enter/exits in the game. //SetNameTagDrawDistance(50.0); // Distance at which nametags will start rendering on the client. //DisableNameTagLOS(); // Disables the nametag Line-Of-Sight checking //LimitGlobalChatRadius(Float:chat_radius); //LimitPlayerMarkerRadius(Float:marker_radius); //dmap_GameModeInit(); MySQLConnect(SQL_HOST, SQL_USER, SQL_PASS, SQL_DB); /*if (CREATE_PLAYER_DATABASE == 0) { mysql_query("CREATE TABLE IF NOT EXISTS server(Server INT(11), Gamemode INT(256))"); format(string, sizeof(string), "INSERT INTO server (Server, Gamemode) VALUES('1', '1')"); mysql_query(string); }*/ format(string, sizeof(string), "SELECT * FROM server WHERE Server = '1'"); mysql_query(string);//Queries mysql_store_result(); //Stores the result if(mysql_num_rows() > 0) { new wdata[128]; while(mysql_retrieve_row()) { mysql_get_field("Gamemode",wdata); CURRENT_GAMEMODE = strval(wdata); } }else{ printf("[MYSQL]: Could Not Retrieve Field - Shutting Down Server.");// SendRconCommand("gmx"); } mysql_free_result(); //Frees the result :) GameDay = 0; GameHour = 0; GameMinute = 0; SetWorldTime(0); new weatherid = random(MAX_WEATHER); SetWeather(RandomWeather[weatherid][0]); if (GameHour < 10) format(string, sizeof(string), "%s, 0%d",WeekDays[GameDay],GameHour); else format(string, sizeof(string), "%s, %d",WeekDays[GameDay],GameHour); if (GameMinute < 10) format(string, sizeof(string), "%s:0%d",string,GameMinute); else format(string, sizeof(string), "%s:%d",string,GameMinute); SendRconCommand("worldtime Sunday 00:00"); new Day, Month, Year;//In Australia we write our Date in the Day - Month - Year Format :) getdate(Year, Month, Day); format(string, sizeof(string), "Server_Chat_Log_%d-%d-%d.txt",Day,Month,Year); strmid(ServerInfo[sChatLog], string, 0, strlen(string), 256); new File:Log = fopen(ServerInfo[sChatLog], io_append); fwrite(Log, "Server Start.\r\n"); fclose(Log); format(string, sizeof(string), "Server_Admin_Log_%d-%d-%d.txt",Day,Month,Year); strmid(ServerInfo[sAdminLog], string, 0, strlen(string), 256); Log = fopen(ServerInfo[sAdminLog], io_append); fwrite(Log, "Server Start.\r\n"); fclose(Log); GameModeTimer = SetTimerEx("GameModeClock", 900, 1, "d", "d"); ZoneNameTimer = SetTimerEx("DisplayZoneNames", 1000, 1, "d", "d"); CheckPointTimer = SetTimerEx("checkpointUpdate", 1000, 1, "d", "d"); MissionTimer = SetTimerEx("OnPlayerMission", 1000, 1, "d", "d"); MapIconTimer = SetTimerEx("MapIconUpdate", 1000, 1, "d", "d"); AreaTimer = SetTimerEx("RestrictedAreaUpdate", 4000, 1, "d", "d"); DriverOnDutyTimer = SetTimerEx("OnDriverOnDuty", 10000, 1, "d", "d"); SecondEventTimer = SetTimerEx("SecondEvents", 500, 1, "d", "d"); BotTimer = SetTimerEx("BotEvents", 10000, 1, "d", "d"); PlayerDiseaseTimer = SetTimerEx("OnPlayerDisease", 5000, 1, "d", "d"); SpeedTimer = SetTimerEx("SpeedOmeter", 1000, 1, "d", "d"); SnowTimer = SetTimerEx("UpdateSnow", 1000, 1, "d", "d"); DrunkTimer = SetTimerEx("OnPlayerDrunk", 10000, 1, "d", "d"); DrugTimer = SetTimerEx("OnPlayerOnDrugs", 5000, 1, "d", "d"); SpamTimer = SetTimerEx("SpamUpdate", 3000, 1, "d", "d"); SpectateTimer = SetTimerEx("OnPlayerSpectate", 5000, 1, "d", "d");