format(Query, sizeof(Query), "INSERT INTO `USERS` (`NAME`, `PASSWORD`, `IP`, `SCORE`, `DINERO`, `ADMINLEVEL`, `LEVEL`, `VIP`, `RANGO`, `KILLS`, `DEATHS`,`EXPERIENCIA`,`MISION`,`MISIONCOUNT`,`CLAN`,`DUELOSGAN`,`DUELOSOUT`,`CARRERAS`,`COLOR`,`SKIN`,`POSX`,`POSY`,`POSZ`) VALUES('%s', '%s', '%s', '%d', '%d', '%d', '%d', '%d', '%f', '%d', '%d', '%f', '%d', '%d', '%d', '%d', '%d', '%d', '%d','%d','%f','%f','%f')",
DB_Escape(PlayerName(playerid)),
DB_Escape(inputtext),
PlayerIp(playerid),
PlayerInfo[playerid][Score],
0,
PlayerInfo[playerid][AdminLevel],
PlayerInfo[playerid][Level],
PlayerInfo[playerid][VipLevel],
PlayerInfo[playerid][Rango],
PlayerInfo[playerid][Kills],
PlayerInfo[playerid][Deaths],
PlayerInfo[playerid][Experiencia],
PlayerInfo[playerid][Mision],
PlayerInfo[playerid][CountMision],
PlayerInfo[playerid][Clan],
PlayerInfo[playerid][DuelosGanados],
PlayerInfo[playerid][DuelosPerdidos],
PlayerInfo[playerid][Carreras],
-1,
-1,
0.0000,
0.0000,
0.0000);
db_query(ADReNaLiNaDB, Query);
format(Query, sizeof(Query), "INSERT INTO `USERS` (`NAME`, `PASSWORD`, `IP`, `SCORE`, `DINERO`, `ADMINLEVEL`, `LEVEL`, `VIP`, `RANGO`, `KILLS`, `DEATHS`,`EXPERIENCIA`,`MISION`,`MISIONCOUNT`,`CLAN`,`DUELOSGAN`,`DUELOSOUT`,`CARRERAS`,`COLOR`,`SKIN`,`POSX`,`POSY`,`POSZ`) VALUES('%s', '%s', '%s', %d, 0, %d, %d, %d, %d, %d, %d, %d, %d, %d, %s, %d, %d, %d, -1, -1, 0.0000, 0.0000, 0.0000)",
DB_Escape(PlayerName(playerid)),
DB_Escape(inputtext),
PlayerIp(playerid),
PlayerInfo[playerid][Score],
PlayerInfo[playerid][AdminLevel],
PlayerInfo[playerid][Level],
PlayerInfo[playerid][VipLevel],
PlayerInfo[playerid][Rango],
PlayerInfo[playerid][Kills],
PlayerInfo[playerid][Deaths],
PlayerInfo[playerid][Experiencia],
PlayerInfo[playerid][Mision],
PlayerInfo[playerid][CountMision],
PlayerInfo[playerid][Clan],
PlayerInfo[playerid][DuelosGanados],
PlayerInfo[playerid][DuelosPerdidos],
PlayerInfo[playerid][Carreras]);
//Preparamos la sentencia
new DBStatement:stmt = db_prepare(ADReNaLiNaDB, "INSERT INTO USERS VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)");
//Establecemos los valores para los signos de interrogaciуn (el primero es 0, el segundo es 1, etc.)
/*
NAME - 0 - STRING
PASSWORD - 1 - STRING
IP - 2 - STRING
SCORE - 3 - INT
DINERO - 4 - INT
ADMINLEVEL - 5 - INT
LEVEL - 6 - INT
VIP - 7 - INT
RANGO - 8 - INT
KILLS - 9 - INT
DEATHS - 10 - INT
EXPERIENCIA - 11 - INT
MISION - 12 - INT
MISIONCOUNT - 13 - INT
CLAN - 14 - STRING (?)
DUELOSGAN - 15 - INT
DUELOSOUT - 16 - INT
CARRERAS - 17 - INT
COLOR - 18 - INT
SKIN - 19 - INT
POSX - 20 - FLOAT
POSY - 21 - FLOAT
POSZ - 22 - FLOAT */
stmt_bind_value(stmt, 0, DB::TYPE_STRING, PlayerName(playerid));
stmt_bind_value(stmt, 1, DB::TYPE_STRING, inputtext);
stmt_bind_value(stmt, 2, DB::TYPE_STRING, PlayerIp(playerid));
//No hay necesidad de usar Escape en ninguna cadena de texto usando sentencias preparadas.
stmt_bind_value(stmt, 3, DB::TYPE_INT, PlayerInfo[playerid][Score]);
stmt_bind_value(stmt, 4, DB::TYPE_INT, 0);
stmt_bind_value(stmt, 5, DB::TYPE_INT, PlayerInfo[playerid][AdminLevel]);
stmt_bind_value(stmt, 6, DB::TYPE_INT, PlayerInfo[playerid][Level]);
stmt_bind_value(stmt, 7, DB::TYPE_INT, PlayerInfo[playerid][VipLevel]);
stmt_bind_value(stmt, 8, DB::TYPE_INT, PlayerInfo[playerid][Rango]);
stmt_bind_value(stmt, 9, DB::TYPE_INT, PlayerInfo[playerid][Kills]);
stmt_bind_value(stmt, 10, DB::TYPE_INT, PlayerInfo[playerid][Deaths]);
stmt_bind_value(stmt, 11, DB::TYPE_INT, PlayerInfo[playerid][Experiencia]);
stmt_bind_value(stmt, 12, DB::TYPE_INT, PlayerInfo[playerid][Mision]);
stmt_bind_value(stmt, 13, DB::TYPE_INT, PlayerInfo[playerid][CountMision]);
stmt_bind_value(stmt, 14, DB::TYPE_STRING, PlayerInfo[playerid][Clan]);
stmt_bind_value(stmt, 15, DB::TYPE_INT, PlayerInfo[playerid][DuelosGanados]);
stmt_bind_value(stmt, 16, DB::TYPE_INT, PlayerInfo[playerid][DuelosPerdidos]);
stmt_bind_value(stmt, 17, DB::TYPE_INT, PlayerInfo[playerid][Carreras]);
stmt_bind_value(stmt, 18, DB::TYPE_INT, -1);
stmt_bind_value(stmt, 19, DB::TYPE_INT, -1);
stmt_bind_value(stmt, 20, DB::TYPE_FLOAT, 0.0000);
stmt_bind_value(stmt, 21, DB::TYPE_FLOAT, 0.0000);
stmt_bind_value(stmt, 22, DB::TYPE_FLOAT, 0.0000);
// Ejecutamos la sentencia
stmt_execute(stmt);
// Despuйs la cerramos.
stmt_close(stmt);
Me ayudo a ti tambiйn
https://sampforum.blast.hk/showthread.php?tid=278188 Y usa el RBIST esta tan rбpido *u* |