21.12.2016, 09:18
Hello.I have a problem with command /banaccount.It does not save the name of the banned player on the database.It saves all other stuffs like time,ban reason,admin etc...but not the name of the player getting baned.
CODE:
Anything wrong there?
CODE:
Anything wrong there?
Код:
stock BanAccount(playerid, giveplayerid[24], time, reason[], ip[]) { new name[24], namegive[24]; if(playerid == 501) format(name, sizeof(name), "Squidward (Anti-Cheat)"); else GetPlayerName(playerid, name, sizeof(name)); new curtime = gettime(); new expire; if(!time) { expire = 1577836800; } else { new Float:banminutes = time * 24 * 60 * 60; new bantime = floatround(banminutes); expire = curtime + bantime; } new q[400]; format(q, sizeof(q), "INSERT INTO bans (id, name, reason, ban_time, issue_time, expiry_time, admin, ip) VALUES ('', '%s', '%s', %d, %d, %d, '%s', '%s')", namegive, reason, time, curtime, expire, name, ip); mysql_query(q, THREAD_INSERT_BAN); /*new banid = mysql_insert_id(); format(q, sizeof(q), "INSERT INTO bans (id, name, reason, ban_time, issue_time, expiry_time, admin, ip) VALUES ('$s', '%s', '%s', %d, %d, %d, '%s', '%s')", banid, giveplayerid, reason, time, curtime, expire, name, ip); mysql_query(q, THREAD_INSERT_BAN);*/ new string[128]; if(time) format(string,sizeof(string), "AdmCmd: %s was offline banned for %d days by %s: %s", giveplayerid, time, GetPlayerNameEx(playerid), reason); else format(string,sizeof(string), "AdmCmd: %s was offline banned permanently by %s: %s", giveplayerid, name, reason); ABroadCast(COLOR_LIGHTRED, string, 2); return 1; }