command; /setmotd - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: command; /setmotd (
/showthread.php?tid=194576)
command; /setmotd -
Scenario - 29.11.2010
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:
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;
}
Error:
Код:
[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)
It's only when I perform this function, however.
Plugin: G-Stylez R5
SA-MP Server Version: 0.3b