Jump to content

Script Query


Guest Mentos

Recommended Posts

Please could someone help me, I've been at this script for ages, and I just cant seem to get it right, if I try to run it, I makes my other scripts crash.

  elseif ($3 == !jail) {
    if ($mta.skin($1,$2) == 1) && ($rpg.criminal($1,%a) == $true) && ($rpg.area($1,%a) == Jail-Cells) && ($mta.name($1,$2) != $mta.name($1,%a))  {
        mta.msg $1 $2 You jailed a criminal. Here's your reward. $chr(36) 100
        mta.msg $1 %a Someone in the jail made you drop soap. Poor bastard.
        !writeini -n " $+ $scriptdir $+ suspectlist.ini" $mta.name($1,$2) cash $calc($rpg.cash($1,$2) + 100)
        !writeini -n " $+ $scriptdir $+ suspectlist.ini" $mta.name($1,%a) criminal 0
 mta.say $1 $mta.name($1,$mta.findid($1,$4)) has been jailed for $5- Minutes!
 !writeini -n " $+ $scriptdir $+ suspectlist.ini" $mta.name($1,$mta.findid($1,$4)) Jailed Yes
 !.timerjail 1 $5 mta.say $1 $mta.name($1,$mta.findid($1,$4)) is now a free man!
 mta.msg $1 $2 You have earned $calc(1700 * $rpg.wantedlvl($1,$mta.findid($1,$4))) $+ !
 !.timer 1 $5 !writeini -n " $+ $scriptdir $+ suspectlist.ini" $mta.name($1,$mta.findid($1,$4)) Jailed No
        }
       elseif ($mta.skin($1,$2) == 1) && ($rpg.criminal($1,%a) == $true) && ($rpg.area($1,%a) == Big-Cell) && ($mta.name($1,$2) != $mta.name($1,%a))  {
        mta.msg $1 $2 You jailed a criminal. Here's your reward. $chr(36) 100
        mta.msg $1 %a Someone in the jail made you drop soap. Poor bastard.
        !writeini -n " $+ $scriptdir $+ suspectlist.ini" $mta.name($1,$2) cash $calc($rpg.cash($1,$2) + 100)
        !writeini -n " $+ $scriptdir $+ suspectlist.ini" $mta.name($1,%a) criminal 0
 mta.say $1 $mta.name($1,$mta.findid($1,$4)) has been jailed for $5- Minutes!
 !writeini -n " $+ $scriptdir $+ suspectlist.ini" $mta.name($1,$mta.findid($1,$4)) Jailed Yes
 !.timerjail 1 $5 mta.say $1 $mta.name($1,$mta.findid($1,$4)) is now a free man!
 mta.msg $1 $2 You have earned $calc(1700 * $rpg.wantedlvl($1,$mta.findid($1,$4))) $+ !
 !.timer 1 $5 !writeini -n " $+ $scriptdir $+ suspectlist.ini" $mta.name($1,$mta.findid($1,$4)) Jailed No
     }
   elseif (!suspect == $3) { 
     var %a = $iif($4,$iif($mta.name($1,$4) != Unknown,$4,$mta.getid($1,$4)),$2) 
     if (Cop* iswm $mta.skin($1,$2).name) { 
       if (%a == -1) mta.msg $1 $2 Error - Absent ID/Name 
       if (%a == $2) mta.msg $1 $2 Error - Can't suspect yourself 
       else { 
         !writeini " $+ $scriptdir $+ suspectlist.ini" List $mta.name($1,%a) 1 
         !writeini " $+ $scriptdir $+ suspectlist.ini" Reasons $mta.name($1,%a) $iif($5,$5-,No Reason) 
         mta.say $1 Server: $mta.name($1,%a) has been suspected by $mta.name($1,$2) : Reason: $iif($5,$5-,None) 
       }      
     } 
     else mta.msg $1 $2 Server: You are not a cop. 
   }
   elseif ($3 == !crime) { 
     var %a = 0,%b 
     while (%a <= $mta.maxplayers($1)) { 
       if ($readini($scriptdir $+ suspectlist.ini,list,$mta.name($1,%a)) == 1) { 
         mta.say $1 Wanted: $mta.name($1,%a) $+ , Reason: $readini($scriptdir $+ suspectlist.ini,reasons,$mta.name($1,%a)) 
       } 
       inc %a 
     } 
   } 
   elseif (!wanted == $3) { 
     var %a = 0,%b 
     while (%a <= $mta.maxplayers($1)) { 
       if ($readini($scriptdir $+ suspectlist.ini,list,$mta.name($1,%a)) == 1) { 
         if (!%b) %b = $mta.name($1,%a) 
         elseif (%b) %b = %b $+ , $mta.name($1,%a) 
       } 
       inc %a 
     } 
     mta.say $1 Wanted Players: $iif(%b,%b,None) 
   } 
 } 
} 
on *:SIGNAL:mta.kill:{ 
 if ($readini($scriptdir $+ suspectlist.ini,list,$mta.name($1,$2)) == 1) { 
   if (Cop* iswm $mta.skin($1,$3).name) { 
     mta.msg $1 $3 Killed a wanted player and u get 100$ of his bounty.
}
!writeini rpg.ini cash mta.name($1,$32) $calc($readini($rpg.ini,cash,$mta.name($1,$2)) + 100
     !remini " $+ $scriptdir $+ suspectlist.ini" List $mta.name($1,$2) 
     !remini " $+ $scriptdir $+ suspectlist.ini" Reasons $mta.name($1,$2) 
     !writeini rpg.ini cash $mta.name($1,$3) $calc($readini(rpg.ini,cash,$mta.name($1,$3)) + 100) 
   } 
 } 
} 

Many Thanks

Link to comment

try this:

on *:SIGNAL:mta.command:{
 if ($3 == !jail) {
   var %a = $iif($4,$iif($mta.name($1,$4) != Unknown,$4,$mta.getid($1,$4)),$2)
   if ((Cop* iswm $mta.skin($1,$2).name) && ($rpg.criminal($1,%a) == $true) && ($2 != %a) && (%a != -1) && ($5 isnum)) {
     if (($rpg.area($1,%a) == Jail-Cells) || ($rpg.area($1,%a) == Big-Cell)) {
       mta.msg $1 $2 You jailed a criminal. Here's your reward. $100
       mta.msg $1 %a Someone in the jail made you drop soap. Poor bastard.
       mta.say $1 $mta.name($1,%a) has been jailed for $5 Minutes!
       .timer 1 1 mta.msg $1 $2 You have earned $calc(1700 * $rpg.wantedlvl($1,%a)) $+ !
       !writeini -n " $+ $scriptdir $+ suspectlist.ini" $mta.name($1,$2) cash $calc($rpg.cash($1,$2) + 100)
       !writeini -n " $+ $scriptdir $+ suspectlist.ini" $mta.name($1,%a) criminal 0
       !writeini -n " $+ $scriptdir $+ suspectlist.ini" $mta.name($1,%a) Jailed Yes
       !.timer 1 $calc($calc($5 * 60) + 1) mta.say $1 $mta.name($1,%a) is now a free man!
       !.timer 1 $calc($5 * 60) !writeini -n " $+ $scriptdir $+ suspectlist.ini" $mta.name($1,%a) Jailed No
     }
   }
 }
 elseif (!suspect == $3) {
   var %a = $iif($4,$iif($mta.name($1,$4) != Unknown,$4,$mta.getid($1,$4)),$2)
   if (Cop* iswm $mta.skin($1,$2).name) {
     if (%a == -1) mta.msg $1 $2 Error - Absent ID/Name
     if (%a == $2) mta.msg $1 $2 Error - Can't suspect yourself
     else {
       !writeini " $+ $scriptdir $+ suspectlist.ini" List $mta.name($1,%a) 1
       !writeini " $+ $scriptdir $+ suspectlist.ini" Reasons $mta.name($1,%a) $iif($5,$5-,No Reason)
       mta.say $1 Server: $mta.name($1,%a) has been suspected by $mta.name($1,$2) : Reason: $iif($5,$5-,None)
     }     
   }
   else mta.msg $1 $2 Server: You are not a cop.
 }
 elseif ($3 == !crime) {
   var %a = 0,%b
   while (%a <= $mta.maxplayers($1)) {
     if ($readini($scriptdir $+ suspectlist.ini,list,$mta.name($1,%a)) == 1) {
       mta.say $1 Wanted: $mta.name($1,%a) $+ , Reason: $readini($scriptdir $+ suspectlist.ini,reasons,$mta.name($1,%a))
     }
     inc %a
   }
 }
 elseif (!wanted == $3) {
   var %a = 0,%b
   while (%a <= $mta.maxplayers($1)) {
     if ($readini($scriptdir $+ suspectlist.ini,list,$mta.name($1,%a)) == 1) {
       if (!%b) %b = $mta.name($1,%a)
       elseif (%b) %b = %b $+ , $mta.name($1,%a)
     }
     inc %a
   }
   mta.say $1 Wanted Players: $iif(%b,%b,None)
 }
}
on *:SIGNAL:mta.kill:{
 if ($readini($scriptdir $+ suspectlist.ini,list,$mta.name($1,$2)) == 1) {
   if (Cop* iswm $mta.skin($1,$3).name) {
     mta.msg $1 $3 Killed a wanted player and u get 100$ of his bounty.
     !writeini rpg.ini cash mta.name($1,$32) $calc($readini(rpg.ini,cash,$mta.name($1,$2)) + 100)
     !remini " $+ $scriptdir $+ suspectlist.ini" List $mta.name($1,$2)
     !remini " $+ $scriptdir $+ suspectlist.ini" Reasons $mta.name($1,$2)
     !writeini rpg.ini cash $mta.name($1,$3) $calc($readini(rpg.ini,cash,$mta.name($1,$3)) + 100)
   }
 }
}

Link to comment
  • 2 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

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