Jump to content

!backup Script


Donvalley

Recommended Posts

Posted

I Have Searched The Forum And Found 1 Backup Script For MTAVC But It Is Really Crappy (No Offence) But I Would Like One Where only cops can ask for backup, and that it only tells other cops in a PM.

on *:SIGNAL:mta.command: { 
%b = $iif($4 isnum,$4,$mta.getid($1,$4)) 
if ($3 == !backup) mta.say $1 The Police Force needs Backup at $mta.area($1,$2) $+ ! 
elseif ($3 == !status) { 
if ($4 != $null) mta.say $1 $mta.name($1,$2) is $mta.status($1,$2).text $+ . 
else mta.say $1 $mta.name($1,%b) is $mta.status($1,%b).text $+ . 
  } 
} 

Thanks In Advance,

Jesse

Posted

I think this will do what is needed.. but I've never made any scripts for anything but mta:sa :?

Have fun trying..

on *:SIGNAL:mta.command: { 
  if ($3 == !backup) { 
    var %a = 0 
    while (%a <= $mta.server($1).cmax) { 
      if ($mta.name($1,%a) != $null) && (($mta.vehicle($1,%a).name == Police) { 
        mta.msg $1 %a The Police Force needs Backup at $mta.area($1,$2) $+ ! 
      } 
      !inc %a 
    } 
  } 
} 

Posted

It will work, but there is just a small brakct error :D

change

      if ($mta.name($1,%a) != $null) && (($mta.vehicle($1,%a).name == Police) { 

to

      if ($mta.name($1,%a) != $null) && ($mta.vehicle($1,%a).name == Police) { 

Posted

Didn't Work This Is The Code

on *:SIGNAL:mta.command: { 
  if ($3 == !backup) { 
    var %a = 0 
    while (%a <= $mta.server($1).cmax) { 
      if ($mta.name($1,%a) != $null) && ($mta.vehicle($1,%a).name == Police) { 
        mta.msg $1 %a The Police Force needs Backup at $mta.area($1,$2) $+ ! 
      } 
      !inc %a 
    } 
  } 
} 
  

Is This Right ?? It Just Does Nothing When You Type !backup>>??

Posted

It will send a pm to all the cops who are in a police vehicle.

If you want the cops to get a pm whether they are in the police vehicle or not, use this:

on *:SIGNAL:mta.command: { 
  if ($3 == !backup) { 
    var %a = 0 
    while (%a <= $mta.server($1).cmax) { 
      if ($mta.name($1,%a) != $null) { 
        mta.msg $1 %a The Police Force needs Backup at $mta.area($1,$2) $+ ! 
      } 
      !inc %a 
    } 
  } 
} 

Posted
It will send a pm to all the cops who are in a police vehicle.

If you want the cops to get a pm whether they are in the police vehicle or not, use this:

on *:SIGNAL:mta.command: { 
  if ($3 == !backup) { 
    var %a = 0 
    while (%a <= $mta.server($1).cmax) { 
      if ($mta.name($1,%a) != $null) { 
        mta.msg $1 %a The Police Force needs Backup at $mta.area($1,$2) $+ ! 
      } 
      !inc %a 
    } 
  } 
} 

Works Perfect But Can You make It So Only Police Can Call FOr Backup??

Posted

I just realised it doesn't pm only cops, it pms everyone.

on *:SIGNAL:mta.command: { 
  if ($3 == !backup) { 
    if ($mta.skin($1,$2).name != Cop) { mta.msg $1 $2 Only cops can use this | !halt } 
    var %a = 0 
    while (%a <= $mta.maxplayers($1)) { 
      if ($mta.name($1,%a) != $null) { 
        mta.msg $1 %a The Police Force needs Backup at $mta.area($1,$2) $+ ! 
      } 
      !inc %a 
    } 
  } 
} 

This will pm just cops:

on *:SIGNAL:mta.command: { 
  if ($3 == !backup) { 
    if ($mta.skin($1,$2).name != Cop) { mta.msg $1 $2 Only cops can use this | !halt } 
    var %a = 0 
    while (%a <= $mta.maxplayers($1)) { 
      if ($mta.name($1,%a) != $null) && ($mta.skin($1,%a) == Cop) { 
        mta.msg $1 %a The Police Force needs Backup at $mta.area($1,$2) $+ ! 
      } 
      !inc %a 
    } 
  } 
} 

Posted

This will pm just cops:

on *:SIGNAL:mta.command: { 
  if ($3 == !backup) { 
    if ($mta.skin($1,$2).name != Cop) { mta.msg $1 $2 Only cops can use this | !halt } 
    var %a = 0 
    while (%a <= $mta.maxplayers($1)) { 
      if ($mta.name($1,%a) != $null) && ($mta.skin($1,%a) == Cop) { 
        mta.msg $1 %a The Police Force needs Backup at $mta.area($1,$2) $+ ! 
      } 
      !inc %a 
    } 
  } 
} 

Didn't Work I Am A Cop And It Says Sorry Only Cops Can Use This?? Help Please??

Posted
Didn't Work I Am A Cop And It Says Sorry Only Cops Can Use This?? Help Please??

It should work, make sure the script is connected before you spawn. Or just respawn when the script is connected.

Posted

This will pm just cops:

on *:SIGNAL:mta.command: { 
  if ($3 == !backup) { 
    if ($mta.skin($1,$2).name != Cop) { mta.msg $1 $2 Only cops can use this | !halt } 
    var %a = 0 
    while (%a <= $mta.maxplayers($1)) { 
      if ($mta.name($1,%a) != $null) && ($mta.skin($1,%a) == Cop) { 
        mta.msg $1 %a The Police Force needs Backup at $mta.area($1,$2) $+ ! 
      } 
      !inc %a 
    } 
  } 
} 

Didn't Work I Am A Cop And It Says Sorry Only Cops Can Use This?? Help Please??

I Think Its This Bit!

 if ($mta.skin($1,$2).name != Cop) { mta.msg $1 $2 Only cops can use this | !halt } 
    var %a = 0 

  • 1 month later...
Posted

dunno if u got this to work, or if u still need it...

but try:

  
on *:SIGNAL:mta.command: { 
  if ($3 == !backup) { 
    if ($mta.skin($1,$2).name != Cop) mta.msg $1 $2 Error: You Are Not A Cop! 
    else { 
      var %a = 0 
      while (%a < $mta.maxplayers($1)) { 
        if (($mta.name($1,%a) != $null) && (%a != $2) && ($mta.skin($1,%a).name == Cop)) mta.msg $1 %a Backup Needed For $mta.name($1,$2) $+ , at $mta.area($1,$2) $+ ! 
        !inc %a 
      } 
    } 
  } 
}  

  • Recently Browsing   0 members

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