07.08.2011, 12:49
try
pawn Код:
stock CheckMySQL(sqlhost[], sqluser[], sqlpass[], sqldb[])
{
print("** Trying to connect to mysql server **");
mysql_connect(sqlhost, sqluser, sqldb, sqlpass);
if(mysql_ping()==1)
{
print("** Server connected **");
return 1;
}
else
{
print("** Server couldn't connect to the database, try again.. **");
mysql_connect(sqlhost, sqluser, sqldb, sqlpass);
if(mysql_ping()==1)
{
print("** Server connected **");
return 1;
}
else
{
print("** Server couldn't connect to the database, server shutdown.**");
SendRconCommand("exit");
return 0;
}
}
}