09.03.2019, 16:06
So I try to log player chat at OnPlayerText and temporarily upped all the values to 500, yet it still doesn't save the large string, only a part of it.
Anyone knows why? See code and screenshot below.
MySQL:
Table:
In-Game:
Anyone knows why? See code and screenshot below.
MySQL:
Table:
In-Game:
PHP Code:
public OnPlayerText(playerid, text[])
{
if(!gamemodeLoaded)
{
SCM(playerid, COLOR_ERROR, "Please wait until the gamemode finishes loading.");
SCM(playerid, COLOR_SERVER, "Your request was not processed.");
return 0;
}
if(!LoggedIn[playerid] || Spawned[playerid] == 0)
{
SCM(playerid, COLOR_ERROR, "You are not logged in or have not spawned yet.");
SCM(playerid, COLOR_SERVER, "You must login and spawn first before your request can be processed.");
return 0;
}
new str[500];
if(AdminDuty[playerid] == 1)
{
format(str, sizeof(str), "(( %s %s(%i): %s ))",ReturnAdminLevel(playerid), ReturnICName(playerid), playerid, text);
ProxDetector(20.0, playerid, str, COLOR_ORANGE);
}
else if(DevDuty[playerid] == 1)
{
format(str, sizeof(str), "(( %s %s(%i): %s ))",ReturnDevLevel(playerid), ReturnICName(playerid), playerid, text);
ProxDetector(20.0, playerid, str, COLOR_DEV);
}
else
{
format(str, sizeof(str), "%s says: %s", ReturnICName(playerid), text);
ProxDetectorColor(20.0, playerid, str, COLOR_GRAD1, COLOR_GRAD2, COLOR_GRAD3, COLOR_GRAD4, COLOR_GRAD5);
SetPlayerChatBubble(playerid, str, COLOR_CHAT, 30, 5000);
}
new query[500];
mysql_format(g_SQL, query, sizeof(query), "INSERT INTO logs_chat(acc_dbid, acc_name, playerid, time, text) VALUES('%i', '%e', '%i', UTC_TIMESTAMP(), '%e')", PlayerInfo[playerid][pDBID], ReturnName(playerid), playerid, text);
mysql_tquery(g_SQL, query);
return 0;
}