When a person borrows the server is seems like the bot does "chattr $nick +R|"
i aint any elete scripter. so i was woundering if it is anyone here who is a good scripter that can "read" the script and see if it is possible to
make it better.
Code: Select all
bind pub - ".borrow" ws:borrow
proc ws:borrow {nick uhost handle chan text} {
if {[info exists ::wsadmin] && [info exists ::wschan] && [string equal -nocase $chan $::wsadmin] && [string equal $text ""]} {
if {[isop $::botnick $::wschan]} {
if {[matchattr $handle +R]} {
puthelp "privmsg $::wschan :Error: You have alredy borrowed the server whitin the 2 hours!"
return 0
} else {
if {$server == "0"} {
set ipmask [lindex [split [maskhost $nick![getchanhost $nick $chan]] "@"] 1]
set userm [lindex [split [getchanhost $nick $chan] "@"] 0]
set userhost *!*$userm@$ipmask
adduser $nick $userhost
chattr $nick +R|
set ::server 1
set ::range 100000
set ::pwrange 1000
set ::rcon [expr {int(rand()*$::range)}]
set ::pass [expr {int(rand()*$::pwrange)}]
exec ./hlds_srv1 -game cstrike +ip 195.*.*.* -port 27010 +map de_dust2 +maxplayers 12 -pingboost 3 -sv_password $::pass -rcon_password $::rcon &
puthelp "privmsg $::wschan :\002Status\002: Just now $nick borrows BETA_SERVER!"
puthelp "cnotice $nick $::wschan :Status: Rcon: $::rcon Password $::pass Port: 27010 IP: 195.*.*.*"
utimer $::waittime "chattr $nick -R|"
utimer $::borrowtime "set ::srv1s 0"
utimer $::borrowtime [list putquick "privmsg $::wschan :Status: BETA_SERVER Is now avalible for borrowing!"]
utimer $::btime "exec killall -q /bin/sh ./hlds_srv1 ./hlds_27010"
return 0
} elseif {$::Server == "1"} {
putquick "privmsg $chan :Server 'BETA_SERVER' Is alredy taken!"
}
}
} else {
puthelp "privmsg $chan :ERROR: need op!"
return 0
}
} else {
puthelp "privmsg $chan :ERROR: Contact an admin!"
return 0
}
}