#define SQL_HOST "localhost" #define SQL_USUARIO "root" #define SQL_CONTRA "usb" #define SQL_DB "servidor" |
public OnGameModeInit()
{
mysql_log(LOG_ALL);
mysql = mysql_connect(SQL_HOST, SQL_USUARIO, SQL_DB, SQL_CONTRA);
if(mysql_errno() != 0)
{
printf("[MySQL] Conexiуn Fallida");
SendRconCommand("exit");
}
else
{
printf("[MySQL] Conexiуn Realizada");
}
return true;
}
public OnGameModeInit() { SetGameModeText("Roleplay"); MySQL = mysql_connect(SQL_HOST,SQL_USUARIO,SQL_DB,SQL_CONT RA); print("Conectando..."); if(mysql_errno() != 0) { print("No se pudo conectar."); } else { print("Conectado."); } return 1; } |
// Declaraciуn de la variable.
new MySQL:hMySQL;
// Callback OnGameModeInit.
public OnGameModeInit()
{
SetGameModeText("Roleplay");
hMySQL = mysql_connect(SQL_HOST, SQL_USUARIO, SQL_CONTRA, SQL_DB);
print("Conectando...");
if(mysql_errno() != 0)
{
print("No se pudo conectar.");
}
else
{
print("Conectado.");
}
return 1;
}
+R40 sufriу cambios en la ubicaciуn de los parametros de mysql_connect. |
Tambiйn se aсadio el tag MySQL, por eso al momento de crear la variable de conexiуn le aсadн dicho tag. |