23.06.2016, 03:15
(
Последний раз редактировалось MotherDucker; 26.06.2016 в 21:32.
)
Hello!
When I ban a user, I input their name, ip, reason etc. however when it stores in the data, it shows a strange character for the ip.
It's strange because the ip is being stored as a string which shouldn't do anything unless it was an unrecognised character.. but it is just a 1... "127.0.0.1"
When I ban a user, I input their name, ip, reason etc. however when it stores in the data, it shows a strange character for the ip.
Код:
CMD:ban(playerid, params[]) { new banid, length, reason[STR_SIZE]; if(mData[playerid][Logged] == true && pData[playerid][Logged] == true && mData[playerid][aLevel] >= 1) { if(sscanf(params, "iiS()["#STR_SIZE"]", banid, length, reason)) return SCM(playerid, GREY, "[Usage]: /ban [playerid] [length] [reason]"); else { if(banid != INVALID_PLAYER_ID) { if(mData[banid][Logged] == true && pData[banid][Logged] == true) { if(!isnull(reason)) { format(str, sizeof(str), "%s has been banned by %s [Reason: %s]", PlayerName(banid), PlayerName(playerid), reason); } else { format(str, sizeof(str), "%s has been banned by %s", PlayerName(banid), PlayerName(playerid)); } SGM(RED, str); MySQL::format(query, "INSERT INTO bandata (ID, Username, IP, Author, Date, Type, Length, Reason) VALUES ('%i', '%s', '%s', '%s', '%s', 0, '%i', '%e')", mData[banid][ID], mData[banid][Username], mData[banid][IP], mData[playerid][Username], Unix(1), length, reason); MySQL::slowQuery(query, false); Kick(banid); } else { return SCM(playerid, GREY, PLAYERNOTLOGGEDIN); } } else { return SCM(playerid, GREY, INVALIDPLAYER); } } } else { return SCM(playerid, GREY, CMDNOTALLOWED); } return 1; }
It's strange because the ip is being stored as a string which shouldn't do anything unless it was an unrecognised character.. but it is just a 1... "127.0.0.1"