Jump to content

uncrime command


Hess

Recommended Posts

Do i have to explain.....

It is used on RPG servers where cops can make people wanted for doing crimes. But the problem is, once they are wanted they stay that way until a cop kills them, so i need a special command where u can remove players from that list.

Link to comment

Give me some information, then i can make it.

1. Where crime database is? (suspects.ini?)

2. Do you use writeini?

Basically you can make it at yourself too, just like in GUS:

gus.substract mta.nick blahblah...

But if you cannot do it, give me these information...

And !crime too...

Link to comment

!uncrime command.... Remove something from a list... I'll write a !crime and !uncrime command:

alias gus.getid {
 var %a = 0
 while (%a <= $mta.server($1).cmax)  {
   if ($+(*,$2,*) iswm $mta.nick($1,%a)) !return %a
   !inc %a
 }
 !return -1
}
on *:Signal:mta.command: {
var %a = $iif($4,$iif($mta.nick($1,$4) != $null,$4,$gus.getid($1,$4)),$2)
if ($3 == !crime) {
var %b = 0
while (%b <= $lines(suspects.txt)) {
if (%a == $read(suspects.txt, %b)) {
set %detect $calc(%detect + 1)
}
!inc %b
}
if (!$4) mta.pm $1 $2 Error: You have to specify a name
elseif (%a == -1) mta.pm $1 $2 Error: Absent ID
elseif (%detect == 1) mta.pm $1 $2 Error: Name already on list
else {
mta.text $1 Suspect " $+ $mta.nick($1,%a) $+ " listed
!write suspects.txt %a
}
}
if ($3 == !uncrime) {
var %b = 0
while (%b <= $lines(suspects.txt)) {
if (%a == $read(suspects.txt, %b)) {
set %detect $calc(%detect + 1)
}
!inc %b
}
if (!$4) mta.pm $1 $2 Error: You have to specify a name
elseif (%a == -1) mta.pm $1 $2 Error: Absent ID
elseif (%detect == 0) mta.pm $1 $2 Error: Name never put on list
else {
mta.text $1 Suspect " $+ $mta.nick($1,%a) $+ " deleted from list
!write -ds $+ %a suspects.txt
}
}
if ($3 == !listsus) || ($3 == !listsuspects) || ($3 ==  !listsuspect) {
var %b = 0
while (%b <= $lines(suspects.txt)) {
if ($mta.nick($1, $+ $read(suspects.txt, %b)) != $null) {
if (!%c) set %c $mta.nick($1, $+ $read(suspects.txt, %b))
elseif ($numtok( %c,32) <= 7) set %c %c $+ , $mta.nick($1, $+ $read(suspects.txt, %b))
elseif (!%d) set %d $mta.nick($1, $+ $read(suspects.txt, %b))
elseif ($numtok( %d,32) <= 7) set %d %d $+ , $mta.nick($1, $+ $read(suspects.txt, %b))
elseif (!%e) set %e $mta.nick($1, $+ $read(suspects.txt, %b))
elseif ($numtok( %e,32) <= 7) set %e %e $+ , $mta.nick($1, $+ $read(suspects.txt, %b))
elseif (!%f) set %f $mta.nick($1, $+ $read(suspects.txt, %b))
elseif ($numtok( %f,32) <= 7) set %f %f $+ , $mta.nick($1, $+ $read(suspects.txt, %b))
elseif (!%g) set %g $mta.nick($1, $+ $read(suspects.txt, %b))
elseif ($numtok( %g,32) <= 7) set %g %g $+ , $mta.nick($1, $+ $read(suspects.txt, %b))
}
!inc %b
}
if (!%c) mta.text $1 There are no suspects listed!
else {
mta.text $1 Suspects Listed: %c
mta.text $1 %d
mta.text $1 %e
mta.text $1 %f
mta.text $1 %g
}
unset %c
unset %d
unset %e
unset %f
unset %g
}
}
on *:signal:mta.part: {
write -ds $+ $2 suspects.txt
}
on *:signal:mta.death: {
write -ds $+ $2 suspects.txt
}
on *:signal:mta.startrace: {
var %b = 0
while (%b <= $mta.server($1).cmax) {
!write -ds $+ %b suspects.txt
}
}

This script should do !uncrime, !crime, !listsus/!listsuspect/!listsuspects and delete anyone on the list on death, part or startrace!

You can add a "GUS" or "Rcon" ristriction by adding a "elseif ($gus.level($1,$2) <= ) / elseif($mta.level($1,$2) <= )"

Link to comment
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...