Hedning Posted September 2, 2006 Share Posted September 2, 2006 If i want to ban someone for e.g 3 days and write /rcon ban3 then he is banned for 3 days. Is this possible? Link to comment
lil Toady Posted September 2, 2006 Share Posted September 2, 2006 (edited) here, you can figure out of this script.. use it like !tempban <#> on *:SIGNAL:mta.command:{ var %a = $iif($4,$iif($mta.nick($1,$4) != Unknown,$4,$mta.getid($1,$4)),$2) if ($3 == !tempban) { if (%a == $2) mta.msg $1 $2 Error - You cant tempban yourself elseif (%a == -1) mta.msg $1 $2 Error - Absent ID else { if ($5 isnum) { if ((m* iswm $6) || (h* iswm $6) || (d* iswm $6)) { if (m* iswm $6) { mta.text $1 $mta.nick($1,%a) has been banned for $5 minute $+ $iif($5 != 1,s) $+ , by $mta.nick($1,$2) $+ . $iif($7,Reason: $7-) !.timer 1 $calc($5 * 60) temp.unban $1 $mta.nick($1,%a) !writeini " $+ $scriptdir $+ tempbans.ini" $mta.server($1) $mta.nick($1,%a) $calc($ctime + $5 * 60) } elseif (h* iswm $6) { mta.text $1 $mta.nick($1,%a) has been banned for $5 hour $+ $iif($5 != 1,s) $+ , by $mta.nick($1,$2) $+ . $iif($7,Reason: $7-) !.timer 1 $calc($5 * 3600) temp.unban $1 $mta.nick($1,%a) !writeini " $+ $scriptdir $+ tempbans.ini" $mta.server($1) $mta.nick($1,%a) $calc($ctime + $5 * 3600) } elseif (d* iswm $6) { mta.text $1 $mta.nick($1,%a) has been banned for $5 day $+ $iif($5 != 1,s) $+ , by $mta.nick($1,$2) $+ . $iif($7,Reason: $7-) !.timer 1 $calc($5 * 86400) temp.unban $1 $mta.nick($1,%a) !writeini " $+ $scriptdir $+ tempbans.ini" $mta.server($1) $mta.nick($1,%a) $calc($ctime + $5 * 86400) } !writeini " $+ $scriptdir $+ tempbans.ini" IPS $mta.nick($1,%a) $mta.ip($1,%a) mta.ban $1 $2 } } } } } on *:SIGNAL:mta.connect:{ while (%a <= $ini($scriptdir $+ tempbans.ini,$mta.server($1),0)) { %b = $readini($scriptdir $+ tempbans.ini,$mta.server($1),$ini($scriptdir $+ tempbans.ini,$mta.server($1),%a)) if (%b) { if ($ctime >= %b) temp.unban $1 $readini($scriptdir $+ tempbans.ini,IPS,$ini($scriptdir $+ tempbans.ini,$mta.server($1),%a)) else !.timer 1 $calc(%b - $ctime) temp.unban $1 $readini($scriptdir $+ tempbans.ini,IPS,$ini($scriptdir $+ tempbans.ini,$mta.server($1),%a)) } !inc %a } } alias temp.unban { mta.unban $1 $2 mta.text $1 $+(',$readini($scriptdir $+ tempbans.ini,IPS,$2),') unbanned. !remini " $+ $scriptdir $+ tempbans.ini" IPS $mta.nick($1,$2) !remini " $+ $scriptdir $+ tempbans.ini" $mta.server($1) $mta.nick($1,$2) } Edited September 3, 2006 by Guest Link to comment
Hedning Posted September 2, 2006 Author Share Posted September 2, 2006 Tx I cant figure it out. but if i want to ban someone i write e.g !tempban dude 60 Then will the dude be banned 60 minutes? But how do i write for hours then? And how do i make it so only admins can use it? I have MTA:SA General Use Scripts | Final Version btw. Hope you understand. Link to comment
lil Toady Posted September 2, 2006 Share Posted September 2, 2006 (edited) here is one for GUS admins with level more than 7 on *:SIGNAL:mta.command:{ var %a = $iif($4,$iif($mta.nick($1,$4) != Unknown,$4,$mta.getid($1,$4)),$2) if ($3 == !tempban) { if ($gus.level($1,$2) >= 7) { if (%a == $2) mta.msg $1 $2 Error - You cant tempban yourself elseif (%a == -1) mta.msg $1 $2 Error - Absent ID elseif ($gus.level($1,$2) <= $gus.level($1,%a)) mta.msg $1 $2 Error - Can't ban a player with the same or higher level else { if ($5 isnum) { if ((m* iswm $6) || (h* iswm $6) || (d* iswm $6)) { if (m* iswm $6) { mta.text $1 $mta.nick($1,%a) has been banned for $5 minute $+ $iif($5 != 1,s) $+ , by $mta.nick($1,$2) $+ . $iif($7,Reason: $7-) !.timer 1 $calc($5 * 60) temp.unban $1 $mta.nick($1,%a) !writeini " $+ $scriptdir $+ tempbans.ini" $mta.server($1) $mta.nick($1,%a) $calc($ctime + $5 * 60) } elseif (h* iswm $6) { mta.text $1 $mta.nick($1,%a) has been banned for $5 hour $+ $iif($5 != 1,s) $+ , by $mta.nick($1,$2) $+ . $iif($7,Reason: $7-) !.timer 1 $calc($5 * 3600) temp.unban $1 $mta.nick($1,%a) !writeini " $+ $scriptdir $+ tempbans.ini" $mta.server($1) $mta.nick($1,%a) $calc($ctime + $5 * 3600) } elseif (d* iswm $6) { mta.text $1 $mta.nick($1,%a) has been banned for $5 day $+ $iif($5 != 1,s) $+ , by $mta.nick($1,$2) $+ . $iif($7,Reason: $7-) !.timer 1 $calc($5 * 86400) temp.unban $1 $mta.nick($1,%a) !writeini " $+ $scriptdir $+ tempbans.ini" $mta.server($1) $mta.nick($1,%a) $calc($ctime + $5 * 86400) } !writeini " $+ $scriptdir $+ tempbans.ini" IPS $mta.nick($1,%a) $mta.ip($1,%a) mta.ban $1 %a } } } } } } on *:SIGNAL:mta.connect:{ while (%a <= $ini($scriptdir $+ tempbans.ini,$mta.server($1),0)) { %b = $readini($scriptdir $+ tempbans.ini,$mta.server($1),$ini($scriptdir $+ tempbans.ini,$mta.server($1),%a)) if (%b) { if ($ctime >= %b) temp.unban $1 $readini($scriptdir $+ tempbans.ini,IPS,$ini($scriptdir $+ tempbans.ini,$mta.server($1),%a)) else !.timer 1 $calc(%b - $ctime) temp.unban $1 $readini($scriptdir $+ tempbans.ini,IPS,$ini($scriptdir $+ tempbans.ini,$mta.server($1),%a)) } !inc %a } } alias temp.unban { mta.unban $1 $2 mta.text $1 $+(',$readini($scriptdir $+ tempbans.ini,IPS,$2),') unbanned. !remini " $+ $scriptdir $+ tempbans.ini" IPS $mta.nick($1,$2) !remini " $+ $scriptdir $+ tempbans.ini" $mta.server($1) $mta.nick($1,$2) } use it like: !tempban dude 50 mins (for 50 mins ban) !tempban dude 2 hours (for 2 hours ban) !tempban dude 1 day (for a day ban) Edited September 3, 2006 by Guest Link to comment
Hedning Posted September 2, 2006 Author Share Posted September 2, 2006 It doesnt work =( I did this.not 5 hours just took the pic when i wrote that. (guess you understand what i mean) After like 5 minutes i get this. And spitz never got banned jsut keeped playing. Link to comment
lil Toady Posted September 2, 2006 Share Posted September 2, 2006 oh try to change var %a = $iif($4,$iif($mta.nick($1,$4) != Unknown,$4,$mta.getid($1,$4)),$2) under 'on *:SIGNAL:mta.command:{' to var %a = $iif($4,$iif($mta.nick($1,$4) != Unknown,$4,$gus.getid($1,$4)),$2) Link to comment
Hedning Posted September 2, 2006 Author Share Posted September 2, 2006 Still same stuff But the ban script in GUS has always been upfucked for me. like !ban dude dude was bla bla bla but is still playing. Link to comment
lil Toady Posted September 2, 2006 Share Posted September 2, 2006 lol, what's you version of mirc and mtama? Link to comment
Hedning Posted September 3, 2006 Author Share Posted September 3, 2006 Mirc: 6.2 mta:ma: 4.15 Link to comment
lil Toady Posted September 3, 2006 Share Posted September 3, 2006 does it give any errors in mirc? try this, if even this won't work, can't help you on my 6.16 mirc works perfect.. on *:SIGNAL:mta.command:{ if ($3 == !tempban) { if ($gus.level($1,$2) >= 7) { var %a = $iif($4,$iif($mta.nick($1,$4) != Unknown,$4,$bla.getid($1,$4)),$2) if (%a == $2) mta.msg $1 $2 Error - You cant tempban yourself elseif (%a == -1) mta.msg $1 $2 Error - Absent ID elseif ($gus.level($1,$2) <= $gus.level($1,%a)) mta.msg $1 $2 Error - Can't ban a player with the same or higher level else { if ($5 isnum) { if ((m* iswm $6) || (h* iswm $6) || (d* iswm $6)) { if (m* iswm $6) { mta.text $1 $mta.nick($1,%a) has been banned for $5 minute $+ $iif($5 != 1,s) $+ , by $mta.nick($1,$2) $+ . $iif($7,Reason: $7-) !.timer 1 $calc($5 * 60) temp.unban $1 $mta.nick($1,%a) !writeini " $+ $scriptdir $+ tempbans.ini" $mta.server($1) $mta.nick($1,%a) $calc($ctime + $5 * 60) } elseif (h* iswm $6) { mta.text $1 $mta.nick($1,%a) has been banned for $5 hour $+ $iif($5 != 1,s) $+ , by $mta.nick($1,$2) $+ . $iif($7,Reason: $7-) !.timer 1 $calc($5 * 3600) temp.unban $1 $mta.nick($1,%a) !writeini " $+ $scriptdir $+ tempbans.ini" $mta.server($1) $mta.nick($1,%a) $calc($ctime + $5 * 3600) } elseif (d* iswm $6) { mta.text $1 $mta.nick($1,%a) has been banned for $5 day $+ $iif($5 != 1,s) $+ , by $mta.nick($1,$2) $+ . $iif($7,Reason: $7-) !.timer 1 $calc($5 * 86400) temp.unban $1 $mta.nick($1,%a) !writeini " $+ $scriptdir $+ tempbans.ini" $mta.server($1) $mta.nick($1,%a) $calc($ctime + $5 * 86400) } !writeini " $+ $scriptdir $+ tempbans.ini" IPS $mta.nick($1,%a) $mta.ip($1,%a) mta.ban $1 %a } } } } } } on *:SIGNAL:mta.connect:{ while (%a <= $ini($scriptdir $+ tempbans.ini,$mta.server($1),0)) { %b = $readini($scriptdir $+ tempbans.ini,$mta.server($1),$ini($scriptdir $+ tempbans.ini,$mta.server($1),%a)) if (%b) { if ($ctime >= %b) temp.unban $1 $readini($scriptdir $+ tempbans.ini,IPS,$ini($scriptdir $+ tempbans.ini,$mta.server($1),%a)) else !.timer 1 $calc(%b - $ctime) temp.unban $1 $readini($scriptdir $+ tempbans.ini,IPS,$ini($scriptdir $+ tempbans.ini,$mta.server($1),%a)) } !inc %a } } alias temp.unban { mta.unban $1 $2 mta.text $1 $+(',$readini($scriptdir $+ tempbans.ini,IPS,$2),') unbanned. !remini " $+ $scriptdir $+ tempbans.ini" IPS $mta.nick($1,$2) !remini " $+ $scriptdir $+ tempbans.ini" $mta.server($1) $mta.nick($1,$2) } alias bla.getid { var %a = 0 while (%a <= $mta.server($1).cmax) { if ($2 isin $mta.nick($1,%a)) !return %a !inc %a } !return -1 } Link to comment
Hedning Posted September 3, 2006 Author Share Posted September 3, 2006 nope deosnt work =( but i will try download that mirc you have then maybe it will owrk. Tx for trying. In mirc i gett this: /writeini: insufficient parameters (line 14, tempban.mrc) When i wrote !tempban hedning 2 mins. Link to comment
Recommended Posts