29.11.2010, 21:30
Hi guys... So I am getting an error when I do this /setmotd command. I believe the command is written correctly and shouldn't give me any errors, but nothing seems to save into the database...
Command:
Error:
It's only when I perform this function, however.
Plugin: G-Stylez R5
SA-MP Server Version: 0.3b
Command:
pawn Код:
command(setmotd, playerid, params[])
{
new string[128];
if(pStats[playerid][pAdminLevel] < 4)
return SendClientMessage(playerid, COLOR_GREY, ADMIN_CMD_ERROR);
if(isnull(params))
return SendClientMessage(playerid, COLOR_WHITE, "SYNTAX: /setmotd [message]"),
SendClientMessage(playerid, COLOR_YELLOW, "Function: Will set the MOTD to what was specified.");
format(string, sizeof(string), "Server MOTD: %s", params);
SendMessageToAll(COLOR_ORANGE, string);
mysql_real_escape_string(params, MOTD);
if(mysql_num_fields() != 0) format(Query, sizeof(Query), "UPDATE `Configurations` SET `MOTD` = '%s'", MOTD);
else format(Query, sizeof(Query), "INSERT INTO `Configurations` (`MOTD`) VALUES('%s')", MOTD);
mysql_query(Query);
AdminLog(GetName(playerid), "Set MOTD");
return 1;
}
Код:
[17:37:40] >> mysql_real_escape_string( Connection handle: 1 ) [17:37:40] CMySQLHandler::EscapeString(Welcome. Please treat this server with respect, unless you want it to close.); - Escaped 76 characters to Welcome. Please treat this server with respect, unless you want it to close.. [17:37:40] >> mysql_num_rows( Connection handle: 1 ) [17:37:40] CMySQLHandler::NumRows() - You cannot call this function now. (Reason: Dead Connection)
Plugin: G-Stylez R5
SA-MP Server Version: 0.3b