Quando o servidor bate um tempo on, tipo bate uns 20 on, ai o sampe server fecha sozinho, e usamos o CrashDetect
|
[01:40:56] [debug] Server crashed while executing roleplay.amx [01:40:56] [debug] AMX backtrace: [01:40:56] [debug] #0 native SetPlayerName () from sscanf.DLL [01:40:56] [debug] #1 0008516c in public OnQueryFinished (2, 5) from roleplay.amx [01:40:56] [debug] Native backtrace: [01:40:56] [debug] #0 00468d34 in ?? () from samp-server.exe [01:40:56] [debug] #1 00567049 in ?? () from plugins\sscanf.DLL [01:40:56] [debug] #2 004010b6 in ?? () from samp-server.exe [01:40:56] [debug] #3 72af62ca in AmxCallback () from plugins\crashdetect.DLL [01:40:56] [debug] #4 72af8b28 in amx_Exec () from plugins\crashdetect.DLL [01:40:56] [debug] #5 72af09c7 in CrashDetect:oAmxExec () from plugins\crashdetect.DLL [01:40:56] [debug] #6 72af631a in AmxExec () from plugins\crashdetect.DLL [01:40:56] [debug] #7 72a151b9 in ?? () from plugins\streamer.DLL [01:40:56] [debug] #8 1000a0ec in ?? () from plugins\mysql.DLL [01:40:56] [debug] #9 00469a66 in ?? () from samp-server.exe [01:40:56] [debug] #10 0048d4db in ?? () from samp-server.exe [01:40:56] [debug] #11 0049b4a1 in ?? () from samp-server.exe [01:40:56] [debug] #12 0049b4b1 in ?? () from samp-server.exe |
echo Executing Server Config... lanmode 0 rcon_password ##### maxplayers 70 port 7777 hostname Brasil Capital Paulista RolePlay Language: Portuguкs Brasileiro PT:BR gamemode0 roleplay filterscripts announce 1 query 1 weburl onfoot_rate 40 incar_rate 40 weapon_rate 40 stream_distance 300.0 stream_rate 1000 maxnpc 0 plugins mysql sscanf crashdetect streamer Whirlpool nativechecker |
forward OnQueryFinished(extraid, threadid); public OnQueryFinished(extraid, threadid) { if (!IsPlayerConnected(extraid)) return 0; static rows, fields ; switch (threadid) { case THREAD_CREATE_CHAR: { PlayerData[extraid][pID] = mysql_insert_id(); PlayerData[extraid][pLogged] = 1; SQL_SaveCharacter(extraid); PlayerData[extraid][pID] = -1; PlayerData[extraid][pLogged] = 0; } case THREAD_CHECK_ACCOUNT: { cache_get_data(rows, fields, g_iHandle); if (rows) { static loginDate[36]; cache_get_row(0, 0, loginDate, g_iHandle); format(PlayerData[extraid][pLoginDate], 36, loginDate); Dialog_Show(extraid, LoginScreen, DIALOG_STYLE_PASSWORD, "Login", "Bem-Vindo de volta a Brasil Capital Paulista - Roleplay!\n\nSua conta foi vista pela ъltima vez em: %s.\n\nPor favor, digite sua senha para logar:", "Logar", "Cancelar", PlayerData[extraid][pLoginDate]); } else { Dialog_Show(extraid, RegisterScreen, DIALOG_STYLE_PASSWORD, "Registrar Conta", "Bem-Vindo a Brasil Capital Paulista - Roleplay, %s.\n\nNoticia: Sua conta nгo estб registrada. Digite a senha desejada:", "Registrar", "Cancelar", ReturnName(extraid)); } } case THREAD_LOGIN: { cache_get_data(rows, fields, g_iHandle); if (!rows) { PlayerData[extraid][pLoginAttempts]++; if (PlayerData[extraid][pLoginAttempts] >= 3) { SendClientMessage(extraid, COLOR_LIGHTRED, "Noticia: Vocк foi kikado, por errar todas as tentativas de login."); KickEx(extraid); } else { Dialog_Show(extraid, LoginScreen, DIALOG_STYLE_PASSWORD, "Login", "Bem-Vindo de volta a Brasil Capital Paulista - Roleplay!\n\nSua conta foi vista pela ъltima vez em: %s.\n\nPor favor, digite sua senha para logar:", "Logar", "Cancelar", PlayerData[extraid][pLoginDate]); SendClientMessageEx(extraid, COLOR_LIGHTRED, "Noticia: Senha incorreta (%d/3 tentativas).", PlayerData[extraid][pLoginAttempts]); } } else { static query[128]; // Update the last login date. format(query, sizeof(query), "UPDATE `accounts` SET `IP` = '%s', `LoginDate` = '%s' WHERE `Username` = '%s'", PlayerData[extraid][pIP], ReturnDate(), PlayerData[extraid][pUsername]); mysql_function_query(g_iHandle, query, false, "", ""); // Load the character data. format(query, sizeof(query), "SELECT * FROM `characters` WHERE `Username` = '%s' LIMIT 3", PlayerData[extraid][pUsername]); mysql_function_query(g_iHandle, query, true, "OnQueryFinished", "dd", extraid, THREAD_CHARACTERS); } } case THREAD_CHARACTERS: { cache_get_data(rows, fields, g_iHandle); for (new i = 0; i < rows; i ++) { cache_get_field_content(i, "Character", PlayerCharacters[extraid][i], g_iHandle); } ShowCharacterMenu(extraid); } case THREAD_LOAD_CHARACTER: { static string[128]; cache_get_data(rows, fields, g_iHandle); foreach (new i : Player) { if (PlayerData[i][pCharacter] == PlayerData[extraid][pCharacter] && !strcmp(ReturnName(i), PlayerCharacters[extraid][PlayerData[extraid][pCharacter] - 1]) && i != extraid) { ShowCharacterMenu(extraid); SendErrorMessage(extraid, "Este personagem jб estб logado."); } } switch (SetPlayerName(extraid, PlayerCharacters[extraid][PlayerData[extraid][pCharacter] - 1])) { case -1: { SendClientMessageEx(extraid, COLOR_LIGHTRED, "Noticia: O nome do seu personagem jб esta em uso."); } default: { if (!rows) { return 0; } static query[128] ; PlayerData[extraid][pID] = cache_get_field_int(0, "ID"); PlayerData[extraid][pCreated] = cache_get_field_int(0, "Created"); PlayerData[extraid][pGender] = cache_get_field_int(0, "Gender"); cache_get_field_content(0, "Birthdate", PlayerData[extraid][pBirthdate], g_iHandle); cache_get_field_content(0, "Origin", PlayerData[extraid][pOrigin], g_iHandle); PlayerData[extraid][pNomeOOC] = cache_get_field_int(0, "NomeOOC"); PlayerData[extraid][pSkin] = cache_get_field_int(0, "Skin"); PlayerData[extraid][pPos][0] = cache_get_field_float(0, "PosX"); PlayerData[extraid][pPos][1] = cache_get_field_float(0, "PosY"); PlayerData[extraid][pPos][2] = cache_get_field_float(0, "PosZ"); PlayerData[extraid][pPos][3] = cache_get_field_float(0, "PosA"); PlayerData[extraid][pHealth] = cache_get_field_float(0, "Health"); PlayerData[extraid][pInterior] = cache_get_field_int(0, "Interior"); PlayerData[extraid][pWorld] = cache_get_field_int(0, "World"); PlayerData[extraid][pHospital] = cache_get_field_int(0, "Hospital"); PlayerData[extraid][pHospitalInt] = cache_get_field_int(0, "HospitalInt"); PlayerData[extraid][pMoney] = cache_get_field_int(0, "Money"); PlayerData[extraid][pBankMoney] = cache_get_field_int(0, "BankMoney"); PlayerData[extraid][pOwnsBillboard] = cache_get_field_int(0, "OwnsBillboard"); PlayerData[extraid][pSavings] = cache_get_field_int(0, "Savings"); PlayerData[extraid][pAdmin] = cache_get_field_int(0, "Admin"); PlayerData[extraid][pJailTime] = cache_get_field_int(0, "JailTime"); PlayerData[extraid][pMuted] = cache_get_field_int(0, "Muted"); PlayerData[extraid][pTester] = cache_get_field_int(0, "Tester"); PlayerData[extraid][pHouse] = cache_get_field_int(0, "House"); PlayerData[extraid][pBusiness] = cache_get_field_int(0, "Business"); PlayerData[extraid][pEntrance] = cache_get_field_int(0, "Entrance"); PlayerData[extraid][pPhone] = cache_get_field_int(0, "Phone"); PlayerData[extraid][pLottery] = cache_get_field_int(0, "Lottery"); PlayerData[extraid][pLottery] = cache_get_field_int(0, "LotteryB"); PlayerData[extraid][pHunger] = cache_get_field_int(0, "Hunger"); PlayerData[extraid][pThirst] = cache_get_field_int(0, "Thirst"); PlayerData[extraid][pPlayingHours] = cache_get_field_int(0, "PlayingHours"); PlayerData[extraid][pMinutes] = cache_get_field_int(0, "Minutes"); PlayerData[extraid][pArmorStatus] = cache_get_field_float(0, "ArmorStatus"); PlayerData[extraid][pJob] = cache_get_field_int(0, "Job"); PlayerData[extraid][pFactionID] = cache_get_field_int(0, "Faction"); PlayerData[extraid][pFactionRank] = cache_get_field_int(0, "FactionRank"); PlayerData[extraid][pPrisoned] = cache_get_field_int(0, "Prisoned"); PlayerData[extraid][pInjured] = cache_get_field_int(0, "Injured"); PlayerData[extraid][pWarrants] = cache_get_field_int(0, "Warrants"); PlayerData[extraid][pChannel] = cache_get_field_int(0, "Channel"); PlayerData[extraid][pBleeding] = cache_get_field_int(0, "Bleeding"); PlayerData[extraid][pAdminHide] = cache_get_field_int(0, "AdminHide"); PlayerData[extraid][pWarnings] = cache_get_field_int(0, "Warnings"); PlayerData[extraid][pMaskID] = cache_get_field_int(0, "MaskID"); PlayerData[extraid][pFactionMod] = cache_get_field_int(0, "FactionMod"); PlayerData[extraid][pCapacity] = cache_get_field_int(0, "Capacity"); PlayerData[extraid][pSpawnPoint] = cache_get_field_int(0, "SpawnPoint"); cache_get_field_content(0, "Warn1", PlayerData[extraid][pWarn1], g_iHandle); cache_get_field_content(0, "Warn2", PlayerData[extraid][pWarn2], g_iHandle); for (new i = 0; i < 13; i ++) { format(query, sizeof(query), "Gun%d", i + 1); PlayerData[extraid][pGuns][i] = cache_get_field_int(0, query); format(query, sizeof(query), "Ammo%d", i + 1); PlayerData[extraid][pAmmo][i] = cache_get_field_int(0, query); } PlayerData[extraid][pGlasses] = cache_get_field_int(0, "Glasses"); PlayerData[extraid][pHat] = cache_get_field_int(0, "Hat"); PlayerData[extraid][pBandana] = cache_get_field_int(0, "Bandana"); cache_get_field_content(0, "GlassesPos", string, g_iHandle); sscanf(string, "p<|>fffffffff", AccessoryData[extraid][0][0], AccessoryData[extraid][0][1], AccessoryData[extraid][0][2], AccessoryData[extraid][0][3], AccessoryData[extraid][0][4], AccessoryData[extraid][0][5], AccessoryData[extraid][0][6], AccessoryData[extraid][0][7], AccessoryData[extraid][0][8]); cache_get_field_content(0, "HatPos", string, g_iHandle); sscanf(string, "p<|>fffffffff", AccessoryData[extraid][1][0], AccessoryData[extraid][1][1], AccessoryData[extraid][1][2], AccessoryData[extraid][1][3], AccessoryData[extraid][1][4], AccessoryData[extraid][1][5], AccessoryData[extraid][1][6], AccessoryData[extraid][1][7], AccessoryData[extraid][1][8]); cache_get_field_content(0, "BandanaPos", string, g_iHandle); sscanf(string, "p<|>fffffffff", AccessoryData[extraid][2][0], AccessoryData[extraid][2][1], AccessoryData[extraid][2][2], AccessoryData[extraid][2][3], AccessoryData[extraid][2][4], AccessoryData[extraid][2][5], AccessoryData[extraid][2][6], AccessoryData[extraid][2][7], AccessoryData[extraid][2][8]); if (!PlayerData[extraid][pMaskID]) PlayerData[extraid][pMaskID] = random(90000) + 10000; if (!PlayerData[extraid][pCapacity]) PlayerData[extraid][pCapacity] = 35; for (new i = 0; i < 81; i ++) { if (i < 8 || (i >= 71 && i <= 80)) PlayerTextDrawHide(extraid, PlayerData[extraid][pTextdraws][i]); } if (PlayerData[extraid][pTester] > 0) { SendClientMessage(extraid, COLOR_CYAN, "[SERVER]:{FFFFFF} Vocк logou como um tester."); } if (PlayerData[extraid][pAdmin] > 0) { SendAdminAction(extraid, "Vocк logou com o level %d de admin.", PlayerData[extraid][pAdmin]); } SendClientMessageEx(extraid, COLOR_BLUE, "Olб %s, seja bem vindo qualquer dъvida, /sos.", ReturnName(extraid, 0)); PlayerData[extraid][pLogged] = 1; SetPlayerColor(extraid, DEFAULT_COLOR); format(query, sizeof(query), "SELECT * FROM `inventory` WHERE `ID` = '%d'", PlayerData[extraid][pID]); mysql_function_query(g_iHandle, query, true, "OnQueryFinished", "dd", extraid, THREAD_LOAD_INVENTORY); format(query, sizeof(query), "SELECT * FROM `contacts` WHERE `ID` = '%d'", PlayerData[extraid][pID]); mysql_function_query(g_iHandle, query, true, "OnQueryFinished", "dd", extraid, THREAD_LOAD_CONTACTS); format(query, sizeof(query), "SELECT * FROM `tickets` WHERE `ID` = '%d'", PlayerData[extraid][pID]); mysql_function_query(g_iHandle, query, true, "OnQueryFinished", "dd", extraid, THREAD_LOAD_TICKETS); format(query, sizeof(query), "SELECT * FROM `gps` WHERE `ID` = '%d'", PlayerData[extraid][pID]); mysql_function_query(g_iHandle, query, true, "OnQueryFinished", "dd", extraid, THREAD_LOAD_LOCATIONS); if(PlayerData[extraid][pOwnsBillboard] == 0) { PlayerData[extraid][pOwnsBillboard] = -1; } if (PlayerData[extraid][pFactionID] != -1) { PlayerData[extraid][pFaction] = GetFactionByID(PlayerData[extraid][pFactionID]); if (PlayerData[extraid][pFaction] == -1) { ResetFaction(extraid); } } if (!PlayerData[extraid][pCreated]) { new str[48]; format(str, sizeof(str), "~r~Nome:~w~ %s", ReturnName(extraid)); PlayerTextDrawSetString(extraid, PlayerData[extraid][pTextdraws][14], str); for (new i = 11; i < 23; i ++) { PlayerTextDrawShow(extraid, PlayerData[extraid][pTextdraws][i]); } PlayerData[extraid][pSkin] = 98; PlayerData[extraid][pOrigin][0] = '\0'; PlayerData[extraid][pBirthdate][0] = '\0'; SendServerMessage(extraid, "Vocк й obrigado a preencher todos os campos."); SetPlayerInterior(extraid, 3); SetPlayerPos(extraid, 364.958312, 173.570709, 990.610534); SetPlayerCameraPos(extraid, 364.958312, 173.570709, 1010.610534); SetPlayerCameraLookAt(extraid, 364.458343, 173.576049, 1010.389343); } else { SetSpawnInfo(extraid, 0, PlayerData[extraid][pSkin], PlayerData[extraid][pPos][0], PlayerData[extraid][pPos][1], PlayerData[extraid][pPos][2], 0.0, 0, 0, 0, 0, 0, 0); TogglePlayerSpectating(extraid, 0); TogglePlayerControllable(extraid, 0); CancelSelectTextDraw(extraid); SetTimerEx("SpawnTimer", 1000, false, "d", extraid); StopAudioStreamForPlayer(extraid); } } } } case THREAD_VERIFY_PASS: { cache_get_data(rows, fields, g_iHandle); if (rows) Dialog_Show(extraid, NewPass, DIALOG_STYLE_PASSWORD, "Insira A Nova Senha", "Digite sua nova senha abaixo.\n\nNota: Por favor, use uma senha forte e segura para seguranзa adicional.", "Mudar", "Cancelar"); else SendErrorMessage(extraid, "Vocк digitou uma senha incorreta."); } case THREAD_FIND_USERNAME: { static query[128]; cache_get_data(rows, fields, g_iHandle); if (rows) { new name[MAX_PLAYER_NAME + 1]; cache_get_row(0, 0, name, g_iHandle); if (strcmp(name, PlayerData[extraid][pUsername], false) != 0) { format(PlayerData[extraid][pUsername], sizeof(name), name); SetPlayerName(extraid, name); } } format(query, sizeof(query), "SELECT `LoginDate` FROM `accounts` WHERE `Username` = '%s'", PlayerData[extraid][pUsername]); mysql_function_query(g_iHandle, query, true, "OnQueryFinished", "dd", extraid, THREAD_CHECK_ACCOUNT); } case THREAD_LOAD_INVENTORY: { static name[32]; cache_get_data(rows, fields, g_iHandle); for (new i = 0; i < rows && i < MAX_INVENTORY; i ++) { InventoryData[extraid][i][invExists] = true; InventoryData[extraid][i][invID] = cache_get_field_int(i, "invID"); InventoryData[extraid][i][invModel] = cache_get_field_int(i, "invModel"); InventoryData[extraid][i][invQuantity] = cache_get_field_int(i, "invQuantity"); cache_get_field_content(i, "invItem", name, g_iHandle); strpack(InventoryData[extraid][i][invItem], name, 32 char); } } case THREAD_LOAD_CONTACTS: { cache_get_data(rows, fields, g_iHandle); for (new i = 0; i < rows && i < MAX_CONTACTS; i ++) { cache_get_field_content(i, "contactName", ContactData[extraid][i][contactName], g_iHandle); ContactData[extraid][i][contactExists] = true; ContactData[extraid][i][contactID] = cache_get_field_int(i, "contactID"); ContactData[extraid][i][contactNumber] = cache_get_field_int(i, "contactNumber"); } } case THREAD_LOAD_LOCATIONS: { cache_get_data(rows, fields, g_iHandle); for (new i = 0; i < rows && i < MAX_GPS_LOCATIONS; i ++) { cache_get_field_content(i, "locationName", LocationData[extraid][i][locationName], g_iHandle); LocationData[extraid][i][locationExists] = true; LocationData[extraid][i][locationID] = cache_get_field_int(i, "locationID"); LocationData[extraid][i][locationPos][0] = cache_get_field_float(i, "locationX"); LocationData[extraid][i][locationPos][1] = cache_get_field_float(i, "locationY"); LocationData[extraid][i][locationPos][2] = cache_get_field_float(i, "locationZ"); } } case THREAD_LOAD_TICKETS: { cache_get_data(rows, fields, g_iHandle); for (new i = 0; i < rows && i < MAX_PLAYER_TICKETS; i ++) { cache_get_field_content(i, "ticketReason", TicketData[extraid][i][ticketReason], g_iHandle); cache_get_field_content(i, "ticketDate", TicketData[extraid][i][ticketDate], g_iHandle); TicketData[extraid][i][ticketExists] = true; TicketData[extraid][i][ticketID] = cache_get_field_int(i, "ticketID"); TicketData[extraid][i][ticketFee] = cache_get_field_int(i, "ticketFee"); } } case THREAD_BAN_LOOKUP: { new reason[128], date[36], username[24]; cache_get_data(rows, fields, g_iHandle); if (rows) { cache_get_field_content(0, "Username", username, g_iHandle); cache_get_field_content(0, "Date", date, g_iHandle); cache_get_field_content(0, "Reason", reason, g_iHandle); if (!strcmp(username, "null", true) || !username[0]) { Dialog_Show(extraid, ShowOnly, DIALOG_STYLE_MSGBOX, "Noticia do Ban", "Seu IP estб banido de nosso servidor.\n\nIP: %s\nData: %s\nMotivo: %s\n\nPara solicitar seu ban appeal's, acesse o nosso fуrum.", "Fechar", "", PlayerData[extraid][pIP], date, reason); KickEx(extraid); } else { Dialog_Show(extraid, ShowOnly, DIALOG_STYLE_MSGBOX, "Noticia do Ban", "Vocк foi banido de nosso servidor.\n\nUsername: %s\nData: %s\nMotivo: %s\n\nPara solicitar seu ban appeal's, acesse o nosso fуrum.", "Fechar", "", PlayerData[extraid][pUsername], date, reason); KickEx(extraid); } } } case THREAD_SHOW_CHARACTER: { cache_get_data(rows, fields, g_iHandle); if (rows) { static skin, birthdate[16], origin[32], string[128]; skin = cache_get_field_int(0, "Skin"); cache_get_field_content(0, "Birthdate", birthdate, g_iHandle); cache_get_field_content(0, "Origin", origin, g_iHandle); PlayerTextDrawSetPreviewModel(extraid, PlayerData[extraid][pTextdraws][73], skin); if (!strlen(birthdate)) { birthdate = "Not Specified"; } if (!strlen(origin)) { origin = "Not Specified"; } format(string, sizeof(string), "~b~Nascimento:~w~ %s", birthdate); PlayerTextDrawSetString(extraid, PlayerData[extraid][pTextdraws][74], string); format(string, sizeof(string), "~b~Pais:~w~ %s", origin); PlayerTextDrawSetString(extraid, PlayerData[extraid][pTextdraws][75], string); format(string, sizeof(string), "~b~Criacao:~w~ %s", GetDuration(gettime() - cache_get_field_int(0, "CreateDate"))); PlayerTextDrawSetString(extraid, PlayerData[extraid][pTextdraws][76], string); format(string, sizeof(string), "~b~Horas:~w~ %s", GetDuration(gettime() - cache_get_field_int(0, "LastLogin"))); PlayerTextDrawSetString(extraid, PlayerData[extraid][pTextdraws][77], string); for (new i = 0; i < 8; i ++) { PlayerTextDrawHide(extraid, PlayerData[extraid][pTextdraws][i]); } for (new i = 71; i < 81; i ++) { PlayerTextDrawShow(extraid, PlayerData[extraid][pTextdraws][i]); } } } } return 1; } |
format(PlayerData[extraid][pUsername], sizeof(name), name);
SetPlayerName(extraid, name);
// Ou aqui
switch (SetPlayerName(extraid, PlayerCharacters[extraid][PlayerData[extraid][pCharacter] - 1]))
switch (SetPlayerName(extraid, PlayerCharacters[extraid][PlayerData[extraid][pCharacter] - 1]))
// Por
new nometeste;
switch(nometeste)