this is my actual thread and I cant continue there cause I dont know how to do something.
In my code at the bottom I need a limit. In the variable add_ban_length I need a simple limit. Everybody can add a ban only with a maximum of 180 minutes. That means you are able to add a ban into the database but not longer than the variable 180, how to do this?
Code: Select all
#######################################
############## Add Ban ################
#######################################
proc ban:db:addban {nick host hand chan arg} {
global sql
set add_player_id [lindex $arg 0]
set add_player_nick [lindex $arg 1]
set add_admin_id [nick2hand $nick]
set add_ban_reason [lindex $arg 2]
set add_ban_time [unixtime]
set add_ban_length [lrange $arg 3 end]
set sql(handle) [mysqlconnect -host $sql(host2) -user $sql(user2) -password $sql(pass2) -db $sql(db2)]
set sma(qry) [mysqlsel $sql(handle) "INSERT INTO amx_bans(player_ip,player_id,player_nick,admin_ip,admin_id,admin_nick,ban_type,ban_reason,ban_created,ban_length,server_ip,server_name) VALUES('0.0.0.0','$add_player_id','$add_player_nick','$host','$add_admin_id','$nick','S','$add_ban_reason','$add_ban_time','$add_ban_length','$chan','IRC');"]
mysqlclose $sql(handle)
putserv "NOTICE $nick :Done."
}