Problema guardado de variables en MySQL
#1

Hola chicos, mirad, tengo este cуdigo de guardado de datos en mi servidor:
pawn Код:
forward SaveAccount(playerid);public SaveAccount(playerid)
{
    new query[1024];GetPlayerPos(playerid, PlayerInfo[playerid][pPosx], PlayerInfo[playerid][pPosy], PlayerInfo[playerid][pPosz]);
    new pName[24]; GetPlayerName(playerid, pName, 24); GetPlayerHealth(playerid, PlayerInfo[playerid][pVida]), GetPlayerArmour(playerid, PlayerInfo[playerid][pChaleco]); // 2740
    format(query, sizeof(query), "UPDATE `usuarios` SET `Vida`='%f', `Chaleco`='%f', `Admin`='%d', `Level`='%d', `Posx`='%f', `Posy`='%f', `Posz`='%f', `Password`='%s', `Tutorial`='%d', `Registrado`='%d', `Team`='%d', `Model`='%d', `Skin`='%d', `ConnectedTime`='%d', `EF`='%d', `Ayudante`='%d', `Sexo`='%d', `Edad`='%d', `Origen`='%d', `Walk`='%d', `Experiencia`='%d', `Cash`='%d', `Banco`='%d', `Cheques`='%d', `Kills`='%d', `Deaths`='%d', `Arrested`='%d', `Loteria`='%d', `Job`='%d', `Jailed`='%d' WHERE `Nombre`='%s'", //2741
    PlayerInfo[playerid][pVida],
    PlayerInfo[playerid][pChaleco],
    PlayerInfo[playerid][pAdmin],
    PlayerInfo[playerid][pLevel],
    PlayerInfo[playerid][pPosx],
    PlayerInfo[playerid][pPosy],
    PlayerInfo[playerid][pPosz],
    PlayerInfo[playerid][pPassword],
    PlayerInfo[playerid][pTut],
    PlayerInfo[playerid][pReg],
    PlayerInfo[playerid][pTeam],
    PlayerInfo[playerid][pModel],
    PlayerInfo[playerid][pChar],
    PlayerInfo[playerid][pConnectTime],
    PlayerInfo[playerid][pEF],
    PlayerInfo[playerid][pAyudante],
    PlayerInfo[playerid][pSexo],
    PlayerInfo[playerid][pEdad],
    PlayerInfo[playerid][pOrigen],
    PlayerInfo[playerid][pWalk],
    PlayerInfo[playerid][pExp],
    GetPlayerMoney(playerid),
    PlayerInfo[playerid][pAccount],
    PlayerInfo[playerid][pCheques],
    PlayerInfo[playerid][pKills],
    PlayerInfo[playerid][pDeaths],
    PlayerInfo[playerid][pArrested],
    PlayerInfo[playerid][pLottoNr],
    PlayerInfo[playerid][pJob],
    PlayerInfo[playerid][pJailed],
    pName);
    mysql_function_query(Conecction, query, true, "OnQueryFinish", "ii", 0, playerid);
    return 1;
}
Todo iba perfecto hasta que aсadн la varbiable "pJailed", me empezaron a salir estos errores (os dejo las lнneas comentadas):

(2740) : error 075: input line too long (after substitutions)
(2741) : error 037: invalid string (possibly non-terminated string)
(2741) : error 017: undefined symbol "UPDATE"
(2741) : error 029: invalid expression, assumed zero
(2741) : fatal error 107: too many error messages on one line
Reply
#2

pawn Код:
forward SaveAccount(playerid);public SaveAccount(playerid)
{
    new query[1024];GetPlayerPos(playerid, PlayerInfo[playerid][pPosx], PlayerInfo[playerid][pPosy], PlayerInfo[playerid][pPosz]);
    new pName[24]; GetPlayerName(playerid, pName, 24); GetPlayerHealth(playerid, PlayerInfo[playerid][pVida]), GetPlayerArmour(playerid, PlayerInfo[playerid][pChaleco]); // 2740
    format(query, sizeof(query), "UPDATE `usuarios` SET `Vida`='%f', `Chaleco`='%f', `Admin`='%d', `Level`='%d', `Posx`='%f', `Posy`='%f', `Posz`='%f', `Password`='%s',`Tutorial`='%d', `Registrado`='%d', `Team`='%d', `Model`='%d', `Skin`='%d', `ConnectedTime`='%d', `EF`='%d', `Ayudante`='%d',`Sexo`='%d', `Edad`='%d', `Origen`='%d', `Walk`='%d', `Experiencia`='%d', `Cash`='%d', `Banco`='%d', `Cheques`='%d', `Kills`='%d', `Deaths`='%d',  WHERE `Nombre`='%s'", //2741
    PlayerInfo[playerid][pVida],
    PlayerInfo[playerid][pChaleco],
    PlayerInfo[playerid][pAdmin],
    PlayerInfo[playerid][pLevel],
    PlayerInfo[playerid][pPosx],
    PlayerInfo[playerid][pPosy],
    PlayerInfo[playerid][pPosz],
    PlayerInfo[playerid][pPassword],
    PlayerInfo[playerid][pTut],
    PlayerInfo[playerid][pReg],
    PlayerInfo[playerid][pTeam],
    PlayerInfo[playerid][pModel],
    PlayerInfo[playerid][pChar],
    PlayerInfo[playerid][pConnectTime],
    PlayerInfo[playerid][pEF],
    PlayerInfo[playerid][pAyudante],
    PlayerInfo[playerid][pSexo],
    PlayerInfo[playerid][pEdad],
    PlayerInfo[playerid][pOrigen],
    PlayerInfo[playerid][pWalk],
    PlayerInfo[playerid][pExp],
    GetPlayerMoney(playerid),
    PlayerInfo[playerid][pAccount],
    PlayerInfo[playerid][pCheques],
    PlayerInfo[playerid][pKills],
    PlayerInfo[playerid][pDeaths],
    pName);
    mysql_function_query(Conecction, query, true, "OnQueryFinish", "ii", 0, playerid);
    format(query, sizeof(query), "UPDATE `usuarios` SET `Arrested`='%d', `Loteria`='%d', `Job`='%d', `Jailed`='%d' WHERE `Nombre`='%s'",
    PlayerInfo[playerid][pArrested],
    PlayerInfo[playerid][pLottoNr],
    PlayerInfo[playerid][pJob],
    PlayerInfo[playerid][pJailed],
    pName)
    mysql_function_query(Conecction, query, true, "OnQueryFinish", "ii", 0, playerid);
    return 1;
}
intenta asi
Reply
#3

Sн, asн me compila sin error. Entonces se guardarбn todos los datos igual pero en dos consultas distintas, cierto?
Reply
#4

es casi lo mismo, aunque creo que podrнas hacerlo en uno mismo saltando la linea en el mismo string ("\") no estoy seguro


ej:

pawn Код:
print("LALALA \
            LALALALALA \
             LALALALALA "
);
Reply
#5

Quote:
Originally Posted by Zume-Zero
Посмотреть сообщение
es casi lo mismo, aunque creo que podrнas hacerlo en uno mismo saltando la linea en el mismo string ("\") no estoy seguro


ej:

pawn Код:
print("LALALA \
            LALALALALA \
             LALALALALA "
);
De esa forma me aparecen igual los errores, tendrй que hacer varias consultas. Eso influye en el rendimiento del servidor o en algo?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)