30.12.2018, 03:31
(
Последний раз редактировалось Stefhan; 30.12.2018 в 04:02.
)
So I have a /osetname command and I want to save it in logs with the database ID of the target, but I'm quite clueless on how to grab that DBID. Still learning MySQL, I've searched on the internet and so on, but I can't figure it out.. Anyone knows? Right now it gives this error. I've marked the code in question red.
I know it gives this error because it's not a indexed value, but how do I solve it so I can grab that id?
Код:
./inc/stock.inc(221) : error 035: argument type mismatch (argument 3)
Код:
forward OnOSetNameProcess(playerid, newname[], oldname[]); public OnOSetNameProcess(playerid, newname[], oldname[]) { new rows, fields, str[128]; cache_get_data(rows, fields); if(!rows) return SCM(playerid, COLOR_ERROR, "That username does not exist."); format(str,sizeof(str), "You have set %s their name to %s.", oldname, newname); SCM(playerid, COLOR_COOLBLUE, str); SCM(playerid, COLOR_INFO, "Please inform the player of this change, or they might lose their account."); new targetid = cache_get_field_content_int(0, "acc_dbid", oldname); format(str, sizeof(str), "%s(%i)[%i] orenamed %s[%i] to %s", ReturnName(playerid), playerid, PlayerInfo[playerid][pDBID], oldname, targetid, newname); StatsLog(str); new query[128]; mysql_format(ourConnection, query, sizeof(query), "UPDATE `accounts` SET `acc_name` = '%e' WHERE `acc_name` = '%e' LIMIT 1", newname, oldname); mysql_tquery(ourConnection, query); return 1; }