11.11.2016, 06:46
Okay this for admins is fixed. But money command is not working.. It gives me money but it won't update it in db
EDIT
I found this in log
There is tons of these.. Any ideas?
PHP код:
CMD:setmoney(playerid, params[])
{
if(PlayerInfo[playerid][Admin] < 4)
{
ERROR(playerid, "You are not allowed to use this command");
return 1;
}
new target, ammount;
if(sscanf(params, "ui", target, ammount))
{
USAGE(playerid, "/setmoney [ID/Name] [Ammount]");
return 1;
}
if(!IsPlayerConnected(target))
{
ERROR(playerid, "That player is not connected");
return 1;
}
ResetPlayerMoney(target);
GivePlayerMoney(target, ammount);
PlayerInfo[target][Money] = ammount;
new string[128], string2[128], query[128];
format(string, sizeof(string), ""YELLOW"[INFO] "WHITE"Admin "SERVERBLUE"%s "WHITE"setted your money to "SERVERBLUE"%d", GetName(playerid), ammount);
SCM(target, -1, string);
format(string2, sizeof(string2), "[INFO] Admin %s setted %s %d$", GetName(playerid), GetName(target), ammount);
AdminMessage(-1, string2);
WriteLog(MONEY, string2);
mysql_format(g_SQL, query, sizeof(query), "UPDATE `players` SET `Money` = %d WHERE `ID` = %d LIMIT 1", ammount, PlayerInfo[target][ID]);
mysql_tquery(g_SQL, query);
return 1;
}
I found this in log
Код:
08:34:48] [ERROR] error #1064 while executing query "UPDATE `players` SET `OrgJoined` = 3 `OrgLeader` = 3 `OrgRank` = 6 WHERE `ID` = 2 LIMIT 1": You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '`OrgLeader` = 3 `OrgRank` = 6 WHERE `ID` = 2 LIMIT 1' at line 1 (C:\Users\Micko\Desktop\MySQL\gamemodes\Untitled.pwn:2003) [08:35:18] [WARNING] mysql_connect: no password specified (C:\Users\Micko\Desktop\MySQL\gamemodes\Untitled.pwn:160) [08:35:50] [ERROR] cache_get_value_name: field 'password' not found (C:\Users\Micko\Desktop\MySQL\gamemodes\Untitled.pwn:591) [08:35:50] [ERROR] cache_get_value_name: field 'salt' not found (C:\Users\Micko\Desktop\MySQL\gamemodes\Untitled.pwn:592) [08:36:01] [ERROR] error #1064 while executing query "UPDATE `players` SET `OrgJoined` = 3 `OrgLeader` = 3 `OrgRank` = 6 WHERE `ID` = 2 LIMIT 1": You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '`OrgLeader` = 3 `OrgRank` = 6 WHERE `ID` = 2 LIMIT 1' at line 1 (C:\Users\Micko\Desktop\MySQL\gamemodes\Untitled.pwn:2003) [08:36:17] [WARNING] mysql_connect: no password specified (C:\Users\Micko\Desktop\MySQL\gamemodes\Untitled.pwn:160) [08:36:51] [ERROR] cache_get_value_name: field 'password' not found (C:\Users\Micko\Desktop\MySQL\gamemodes\Untitled.pwn:591) [08:36:51] [ERROR] cache_get_value_name: field 'salt' not found (C:\Users\Micko\Desktop\MySQL\gamemodes\Untitled.pwn:592)