06.09.2016, 23:16
Buenas la cosa estб en que yo veo que en el cуdigo todo estб bien pero no quiere funcionar.... cuando desconectas o conectas no guarda la posiciуn del jugador ni la carga, aveces sale 50 50 50 en la x y z cuando nada que ver y siempre haces spawn en BlueBerry estando todo bien en el pawno, y el mysql_log deja esto en el cargado y no entiendo el motivo, busquй temas en inglйs del error y los dejan sin respuesta.
(asн con todo los cargados)
En la base de dato PosX - PosY y PosZ estбn como float, todo bien pero no funciona..
Код:
08:36:07 cache_get_field_content_int OK row: 0, field_name: "Administrador", connection: 1 08:36:07 CMySQLResult::GetRowDataByName() ERROR invalid row index ('0') 08:36:07 cache_get_field_content_int ERROR invalid datatype
Код:
Cundo logueas se llama el cargado new Query[128]; mysql_format(MySQL, Query, sizeof Query, "SELECT * FROM users WHERE Usuario = '%e' LIMIT 1", GetPlayerNameEx(playerid)); mysql_tquery(MySQL, Query, "OnAccountLoad", "i", playerid); Este es el cargado.. CALLBACK: OnAccountLoad(playerid) { BitFlag_On(VariablesTemporales_[playerid], eLogged); GetPlayerName(playerid, InformacionJugador_[playerid][pUsuario], MAX_PLAYER_NAME + 1); InformacionJugador_[playerid][pAdministrador] = cache_get_field_content_int(0, "Administrador"); InformacionJugador_[playerid][pPos][0] = cache_get_field_content_float(0, "PosX"); InformacionJugador_[playerid][pPos][1] = cache_get_field_content_float(0, "PosY"); InformacionJugador_[playerid][pPos][2] = cache_get_field_content_float(0, "PosZ"); InformacionJugador_[playerid][pNivel] = cache_get_field_content_int(0, "Nivel"); InformacionJugador_[playerid][pSkin] = cache_get_field_content_int(0, "Skin"); GivePlayerCash(playerid, cache_get_field_content_int(0, "Dinero")); SetPlayerScore(playerid, InformacionJugador_[playerid][pNivel]); if(cache_get_field_content_int(0, "Ban")) { new string[70], BanMotiv[33]; cache_get_field_content(0, "BanReason", BanMotiv[32], MySQL, 32); format(string, sizeof string, "ЎEsta cuenta estб excluida de la comunidad! Motivo: %s", BanMotiv); SendClientMessage(playerid, COLOR_GRIS_2, string); SetTimerEx("KickTimer", 500, false, "d", playerid); } BitFlag_Off(VariablesTemporales_[playerid], eAdminDuty); SetSpawnInfo(playerid, NO_TEAM, InformacionJugador_[playerid][pSkin], InformacionJugador_[playerid][pPos][0], InformacionJugador_[playerid][pPos][1], InformacionJugador_[playerid][pPos][2], 1.0, -1, -1, -1, -1, -1, -1); TogglePlayerSpectating(playerid, false), SpawnPlayer(playerid); return 1; } Y este es el guardado. CALLBACK: ActualizarJugador(playerid) { new Query[512]; GetPlayerPos(playerid, InformacionJugador_[playerid][pPos][0], InformacionJugador_[playerid][pPos][1], InformacionJugador_[playerid][pPos][2]); format(Query, sizeof(Query), "UPDATE users SET PosX = %f, PosY = %f, PosZ = %f, Skin = %d, Dinero = %d, Nivel = %d WHERE SQLID = %d", InformacionJugador_[playerid][pPos][0], InformacionJugador_[playerid][pPos][1], InformacionJugador_[playerid][pPos][2], InformacionJugador_[playerid][pSkin], InformacionJugador_[playerid][pDinero], InformacionJugador_[playerid][pNivel], InformacionJugador_[playerid][pSQLID]); mysql_tquery(MySQL, Query, "", ""); return 1; }