Jump to content

My Personal [SMJ] Script


[DDC]4:20

Recommended Posts

Ok, I'll be the very first to admit it. I am a beginner scripter and I am not very good.

Now that that is done, I have managed to create (With help from many scripts and

some guidence from [XE]Tommis himself) a basic points script.

Yes I know there are tonnes of scripts I can use, But I do this for my education as

as well as for fun.

Well, you may have guessed it. It is not working properly.

While I continue to try to fix my errors (Which I am sure are elementary mistakes),

I thought I would also post it here in hopes someone could show me what I am doing

wrong and how to do it right.

Ok. here goes. My basic Points Script.

  
on *:SIGNAL:mta.connect: {  
  
  connect $1- 
  mta.text $1 Script Reconnected...  
  
} 
  
on *:SIGNAL:mta.disconnect: { 
  
  disconnect $1- 
  .timer 1 2 mta.connect $1 
} 
  
on *:SIGNAL:mta.startrace: {  
  
  newrace $1- 
   
} 
  
on *:SIGNAL:mta.join: { 
  
  join $1- 
  
} 
  
on *:SIGNAL:mta.death: {   
  
  death $1-   
  survivors $1- 
  
} 
  
on *:SIGNAL:mta.respawn: {   
  
  respawn $1- 
  survivors $1- 
   
} 
  
on *:SIGNAL:mta.part: {  
  
  part $1-   
  survivors $1- 
  
} 
  
on *:SIGNAL:mta.command: { 
  
  var %a = $iif($4,$iif($mta.nick($1,$4) != $null,$4,$getid($1,$4)),$2) 
  
  if ($3 == !points) { 
    if (%a == -1) mta.pm $1 $2 Error - Player Not Present. 
    else mta.pm $1 $2 $mta.nick($1,%a) Has $iif($readini(sweetmaryjane.ini,POINTS,$mta.nick($1,%a)),$v1,0) Points. 
  } 
  
  elseif ($3 == !alive) mta.pm $1 $2 %alive Players Are Still Alive. 
  elseif ($3 == !dead) mta.pm $1 $2 %dead Players Are Currently Dead. 
  elseif ($3 == !deaths) mta.pm $1 $2 Total Deaths This Round Is %deaths $+ . 
  elseif ($3 == !ghosts) mta.pm $1 $2 There Are %ghosts Ghosts In The Server. 
  elseif ($3 == !players) mta.pm $1 $2 There Are $mta.server($1).players Players Currently In The Server. 
  elseif ($3 == !mode) mta.pm $1 $2 The Current Map Mode Is %mode $+ . 
  elseif ($3 == !commands) mta.pm $1 $2 Your Alailable Commands Are: !alive,!dead,!deaths,!ghosts,!players,!mode,!points. 
  
} 
  
alias getid {  
  
  var %a = 0   
  
  while (%a <= $mta.server($1).players) { 
    if ($+(*,$2,*) iswm $mta.nick($1,%a)) !return %a 
    !inc %a 
  }   
  
  !return -1 
  
} 
  
alias disconnect { 
   
  !remini -n sweetmaryjane.ini STATUS 
  
  set %alive 0 
  set %dead 0 
  set %deaths 0 
  set %ghosts 0 
  set %mode N/A 
  
} 
  
alias connect { 
   
  set %alive 0 
  set %dead 0 
  set %deaths 0 
  set %ghosts 0 
  set %mode DM 
  
} 
  
alias join { 
  
  !writeini -n sweetmaryjane.ini STATUS $mta.nick($1,$2) GHOST 
  
  set %ghosts $calc(%ghosts + 1) 
  
} 
  
alias death { 
  
  !writeini -n sweetmaryjane.ini STATUS $mta.nick($1,$2) DEAD 
  
  set %alive $calc(%alive - 1) 
  set %dead $calc(%dead + 1) 
  set %deaths $calc(%deaths + 1) 
  
} 
  
alias respawn ( 
  
  if $readini(sweetmaryjane.ini,STATUS,$mta.nick($1,$2),GHOST) { 
    set %ghosts $calc(%ghosts - 1) 
    set %alive $calc(%alive + 1) 
  } 
  
  elseif $readini(sweetmaryjane.ini,STATUS,$mta.nick($1,$2),DEAD) { 
    set %alive $calc(%alive + 1) 
    set %dead $calc(%dead - 1) 
  } 
  
  elseif (%mode == DM) { 
    set %mode RSDM 
  } 
  
  !writeini -n sweetmaryjane.ini STATUS $mta.nick($1,$2) ALIVE   
  
} 
  
alias part { 
  
  if $readini(sweetmaryjane.ini,STATUS,$mta.nick($1,$2),GHOST) set %ghosts $calc(%ghosts - 1) 
  if $readini(sweetmaryjane.ini,STATUS,$mta.nick($1,$2),ALIVE) set %alive $calc(%alive - 1) 
  if $readini(sweetmaryjane.ini,STATUS,$mta.nick($1,$2),ALIVE) set %dead $calc(%dead + 1) 
  if $readini(sweetmaryjane.ini,STATUS,$mta.nick($1,$2),ALIVE) set %deaths $calc(%deaths + 1) 
   
  !writeini -n sweetmaryjane.ini STATUS $mta.nick($1,$2) PARTED   
  
} 
  
alias newrace { 
   
  !remini -n sweetmaryjane.ini STATUS 
  
  set %alive $mta.server($1).players 
  set %dead 0 
  set %deaths 0 
  set %ghosts 0 
  set %mode DM 
  
  var %a = 0 
  
  while (%a <= $mta.server($1).players) { 
    if ($mta.nick($1,%a) != Unknown) { 
      !writeini -n sweetmaryjane.ini STATUS $mta.nick($1,%a) ALIVE 
      !inc %a 
    } 
  
  } 
  
} 
  
alias survivors { 
  
  if (%mode == DM) { 
  
    if (%alive == 1) { 
     
    var %a = 0 
  
    while (%a <= $mta.server($1).players) { 
      if ($mta.nick($1,%a) != Unknown) { 
        mta.text $1 $mta.nick($1,%a) Has Survived " $+ $mta.race($1) $+ " And Earned %dead Points! 
        !writeini -n sweetmaryjane.ini POINTS $mta.nick($1,%a) $calc($points($1,%a) + %dead) 
        !inc %a 
        } 
  
      } 
   
    }        
  
  } 
  
  elseif (%mode == RSDM) { 
  
    if (%alive == 1) {   
  
    var %a = 0 
  
    while (%a <= $mta.server($1).players) { 
      if ($mta.nick($1,%a) != Unknown) { 
        mta.text $1 $mta.nick($1,%a) Is Currently The Only Player Alive! %deaths Points Awarded! 
        !writeini -n sweetmaryjane.ini POINTS $mta.nick($1,%a) $calc($points($1,%a) + %deaths) 
        !inc %a     
        } 
  
      } 
  
    } 
   
  } 
  
} 
  
alias points !return $iif($readini(sweetmaryjane.ini,POINTS,$mta.nick),$v1,0) 
  

Sorry for the lenght. I am sure there are many things that should be changed,

So I thought I should post the entire script. Thank You to anyone who takes the time

to help me out.

EDITED

Edited by Guest
Link to comment

Well, I was informed that the usless spaces were harmless.

The reason for them is that is simply helps me read it.

Script has been edited and reposted.

Really thats all you could say ???

Well,,, I really didn't expect much from you lol.

BTW, Yes, New nick here. I am far far from newbie...

Again, Thanks for anyones time that is willing to lend it.

Link to comment

YAY, I DID IT!!!!!!!!!

Thanks to [XE]Tommis and [uVA]Bart for their time, too bad they couldn't figure it out LOL.

Anyways, I had a look through previous scripts [XE]Tommis has helped me on and I came to

a realization. I felt I was reading the ini wrong, and BINGO!!!!!

I was trying to check a players status using...

if $readini(sweetmaryjane.ini,STATUS,$mta.nick($1,$2),GHOST) {

What I needed to be doing is checking like this...

if (GHOST isin $readini(sweetmaryjane.ini,STATUS,$mta.nick($1,$2))) {

I am soo excited LOL

So, I will reedit my first post with the current (seemingly working well) script.

I would still appreciate ANY feedback on errors, efficeincy ect.

Again, thanks for any time spent with this!

4:20

EDIT

Seems I am unable to edit a previous post if I have posted since.

So, new script is here...

  
on *:SIGNAL:mta.connect: {  
  connect $1- 
} 
on *:SIGNAL:mta.disconnect: { 
  disconnect $1- 
  .timer 1 2 mta.connect $1 
} 
on *:SIGNAL:mta.startrace: {  
  newrace $1- 
} 
on *:SIGNAL:mta.join: { 
  join $1- 
} 
on *:SIGNAL:mta.death: {   
  death $1-   
  survivors $1- 
} 
on *:SIGNAL:mta.respawn: {   
  respawn $1- 
} 
on *:SIGNAL:mta.part: {  
  part $1-   
  survivors $1- 
} 
on *:SIGNAL:mta.command: { 
  var %a = $iif($4,$iif($mta.nick($1,$4) != $null,$4,$getid($1,$4)),$2) 
  if ($3 == !points) { 
    if (%a == -1) mta.pm $1 $2 Error - Player Not Present. 
    else { 
      mta.pm $1 $2 $mta.nick($1,%a) Has $iif($readini(sweetmaryjane.ini,POINTS,$mta.nick($1,%a)),$v1,0) Points. 
    } 
  } 
  elseif ($3 == !alive) mta.pm $1 $2 %alive Players Are Still Alive. 
  elseif ($3 == !dead) mta.pm $1 $2 %dead Players Are Currently Dead. 
  elseif ($3 == !deaths) mta.pm $1 $2 Total Deaths This Round Is %deaths $+ . 
  elseif ($3 == !ghosts) mta.pm $1 $2 There Are %ghosts Ghosts In The Server. 
  elseif ($3 == !players) mta.pm $1 $2 There Are $mta.server($1).players Players Currently In The Server. 
  elseif ($3 == !mode) mta.pm $1 $2 The Current Map Mode: %mode $+ . 
  elseif ($3 == !commands) mta.pm $1 $2 Your Alailable Commands Are: !alive,!dead,!deaths,!ghosts,!players,!mode,!points. 
} 
alias getid {  
  var %a = 0   
  while (%a <= $mta.server($1).players) { 
    if ($+(*,$2,*) iswm $mta.nick($1,%a)) !return %a 
    !inc %a 
  }   
  !return -1 
} 
alias disconnect {   
  set %alive 0 
  set %dead 0 
  set %deaths 0 
  set %ghosts 0 
  set %mode N/A 
  !remini -n sweetmaryjane.ini STATUS 
} 
alias connect { 
  set %alive 0 
  set %dead 0 
  set %deaths 0 
  set %ghosts 0 
  set %mode N/A 
  !remini -n sweetmaryjane.ini STATUS 
  mta.text $1 Script Reconnected...  
} 
alias join { 
  set %ghosts $calc(%ghosts + 1) 
  !writeini -n sweetmaryjane.ini STATUS $mta.nick($1,$2) GHOST 
} 
alias death {   
  set %alive $calc(%alive - 1) 
  set %dead $calc(%dead + 1) 
  set %deaths $calc(%deaths + 1) 
  !writeini -n sweetmaryjane.ini STATUS $mta.nick($1,$2) DEAD 
} 
alias respawn { 
  if (%mode == DM) { 
    set %mode RSDM 
  } 
  if (GHOST isin $readini(sweetmaryjane.ini,STATUS,$mta.nick($1,$2))) { 
    set %ghosts $calc(%ghosts - 1) 
    set %alive $calc(%alive + 1) 
    } 
    elseif (DEAD isin $readini(sweetmaryjane.ini,STATUS,$mta.nick($1,$2))) { 
      set %alive $calc(%alive + 1) 
      set %dead $calc(%dead - 1) 
    } 
  !writeini -n sweetmaryjane.ini STATUS $mta.nick($1,$2) ALIVE   
} 
alias part { 
  if (GHOST isin $readini(sweetmaryjane.ini,STATUS,$mta.nick($1,$2))) { 
    set %ghosts $calc(%ghosts - 1) 
    !writeini -n sweetmaryjane.ini STATUS $mta.nick($1,$2) PARTED   
  } 
  elseif (ALIVE isin $readini(sweetmaryjane.ini,STATUS,$mta.nick($1,$2))) { 
    set %alive $calc(%alive - 1) 
    set %dead $calc(%dead + 1) 
    set %deaths $calc(%deaths + 1) 
    !writeini -n sweetmaryjane.ini STATUS $mta.nick($1,$2) PARTED   
  } 
  elseif (DEAD isin $readini(sweetmaryjane.ini,STATUS,$mta.nick($1,$2))) { 
    !writeini -n sweetmaryjane.ini STATUS $mta.nick($1,$2) PARTED   
  } 
} 
alias newrace { 
  set %alive $mta.server($1).players 
  set %dead 0 
  set %deaths 0 
  set %ghosts 0 
  set %mode DM 
  !remini -n sweetmaryjane.ini STATUS 
  if (%alive <= $mta.server($1).players) { 
    var %a = 0 
    while (%a <= $mta.server($1).players) { 
      if ($mta.nick($1,%a) != Unknown) { 
        !writeini -n sweetmaryjane.ini STATUS $mta.nick($1,%a) ALIVE 
      }       
      !inc %a 
    } 
  } 
} 
alias survivors { 
  if (%mode == DM) { 
    if (%alive == 1) { 
      var %a = 0 
      while (%a <= $mta.server($1).players) { 
        if ($mta.nick($1,%a) != Unknown) { 
          mta.text $1 $mta.nick($1,%a) Has Survived " $+ $mta.race($1) $+ " And Earned %dead Points! 
          !writeini -n sweetmaryjane.ini POINTS $mta.nick($1,%a) $calc($points($1,%a) + %dead) 
          !halt 
        }       
        !inc %a   
      } 
    }        
  } 
  elseif (%mode == RSDM) { 
    if (%alive == 1) {   
      var %a = 0 
      while (%a <= $mta.server($1).players) { 
        if ($mta.nick($1,%a) != Unknown) { 
          mta.text $1 $mta.nick($1,%a) Is Currently The Only Player Alive! %deaths Points Awarded! 
          !writeini -n sweetmaryjane.ini POINTS $mta.nick($1,%a) $calc($points($1,%a) + %deaths) 
          !halt 
        }   
        !inc %a             
      } 
    } 
  } 
} 
alias points !return $iif($readini(sweetmaryjane.ini,POINTS,$mta.nick($1,$2)),$v1,0) 
  

Link to comment

I feel awkwark doing a double post, But I have no choice...

Partial Quote From FAQ

"How do I edit or delete a post?"

You can edit a post by clicking the edit button for the relevant post,

sometimes for only a limited time after the post was made.

Seems I am unable to edit my previous posts...

Ok, I have quite a bit of my script put together now.

I will assume, since I can't edit my previous posts, that it is safe for me

to use this thread as a QA/Show thread for my script.

If someone sees the length of my script to be a issue due to post length,

just say so (And advise me of a better way). If not, I will assume all is well.

Here is the "Updated" Script...

  
on *:SIGNAL:mta.connect: {
  connect $1-
}
on *:SIGNAL:mta.disconnect: {
  disconnect $1-
}
on *:SIGNAL:mta.startrace: {
  startrace $1-
}
on *:SIGNAL:mta.join: {
  join $1-
}
on *:SIGNAL:mta.death: {  
  death $1-  
  survivors $1-
}
on *:SIGNAL:mta.respawn: {  
  respawn $1-
}
on *:SIGNAL:mta.text: {
  sleep.check $1-
}
on *:SIGNAL:mta.part: {
  part $1-  
  survivors $1-
}
on *:SIGNAL:mta.command: {
  var %a = $iif($4,$iif($mta.nick($1,$4) != $null,$4,$getid($1,$4)),$2)
  if ($3 == !points) {
    if (%a == -1) mta.pm $1 $2 Error - Player Not Present.
    else {
      mta.pm $1 $2 $mta.nick($1,%a) Has $iif($readini(sweetmaryjane.ini,POINTS,$mta.nick($1,%a)),$v1,0) Points.
    }
  }
  elseif ($3 == !kick) {  
    if ($mta.level($1,$2) >= 3) mta.kick $1 %a
  }
  elseif ($3 == !votekick) {
    if ($mta.level($1,$2) >= 2) {
      if (%vote.nick. [ $+ [ $1 ] ] != $null) mta.pm $1 $2 Another Votekick Is Currently Running On $mta.nick($1,%vote.nick. [ $+ [ $1 ] ])
      elseif ($mta.server($1).players < 3) mta.pm $1 $2 Error...There Must Be At Least 3 Players In The Server To Start A Votekick.
      elseif (%a == -1) mta.pm $1 $2 Error - Invalid Nick...
      elseif (%a == $2) mta.pm $1 $2 Error...You Can't Votekick Yourself...
      else {
        set %vote.nick. [ $+ [ $1 ] ] %a
        unset %vote.voters. [ $+ [ $1 ] ]
        mta.text $1 Type "!vote" If You Think $mta.nick($1,%a) Should Be Kicked. [ $round($calc($mta.server($1).players / 2),0) votes needed] [1 minute]
        .timervote [ $+ [ $1 ] ] 1 60 cancel.votekick $1
      }
    }
  }
  elseif ($3 == !ban) {
    if ($mta.level($1,$2) >= 4) mta.ban $1 %a
  }
  elseif ($3 == !mute) {
    if ($mta.level($1,$2) >= 3) mta.mute $1 %a
  }
  elseif ($3 == !unmute) {
    if ($mta.level($1,$2) >= 3) mta.unmute $1 %a
  }
  elseif ($3 == !freeze) {
    if ($mta.level($1,$2) >= 3) mta.freeze $1 %a
  }
  elseif ($3 == !unfreeze) {
    if ($mta.level($1,$2) >= 3) mta.unfreeze $1 %a
  }
  elseif ($3 == !tm) {
    if ($mta.level($1,$2) >= 3) {
      mta.mute $1 %a
      .timerunmute 1 15 mta.unmute $1 %a
    }
  }
  elseif ($3 == !tf) {
    if ($mta.level($1,$2) >= 3) {
      mta.freeze $1 %a
      .timerunfreeze 1 15 mta.unfreeze $1 %a
    }
  }
  elseif ($3 == !admins) {
    if ($mta.level($1,$2) >= 2) admin.count $1-
  }
  elseif ($3 == !newmap) {
    if ($mta.level($1,$2) >= 3) {
      mta.text $1 Starting Random Map...
      .timer 1 2 mta.startrace $1 $rand(0,$mta.races($1))
    }
  }
  elseif ($3 == !alive) mta.pm $1 $2 %alive Players Are Still Alive.
  elseif ($3 == !dead) mta.pm $1 $2 %dead Players Are Currently Dead.
  elseif ($3 == !deaths) mta.pm $1 $2 Total Deaths This Round Is %deaths $+ .
  elseif ($3 == !ghosts) mta.pm $1 $2 There Are %ghosts Ghosts In The Server.
  elseif ($3 == !players) mta.pm $1 $2 There Are $mta.server($1).players Players Currently In The Server.
  elseif ($3 == !mode) mta.pm $1 $2 The Current Map Mode Is %mode $+ .
  elseif ($3 == !commands) {
    mta.pm $1 $2 Your Alailable Commands Are: !alive,!dead,!deaths,!ghosts,!server,!players,!mode, !points,!brb,!back,!wb,!mapname,!mapcount.
    if ($mta.level($1,$2) == 2) {
      mta.pm $1 $2 !sleep,!votekick,!admins.
    }
    if ($mta.level($1,$2) == 3) {
      mta.pm $1 $2 !sleep,!votekick,!admins,!kick,!mute,!unmute,!freeze, !unfreeze,!tm,!tf,!newmap, !reset.
    }
    if ($mta.level($1,$2) == 4) {
      mta.pm $1 $2 !sleep,!votekick,!admins,!kick,!mute,!unmute,!freeze, !unfreeze,!tm,!tf,!newmap, !reset,!ban.
    }
    if ($mta.level($1,$2) == 5) {
      mta.pm $1 $2 !sleep,!votekick,!admins,!kick,!mute,!unmute,!freeze, !unfreeze,!tm,!tf,!newmap, !reset,!ban.
    }
  }
  elseif ($3 == !brb) mta.text $1 $mta.nick($1,$2) Will Be Right Back! $iif($4, Reason: $4-)
  elseif ($3 == !back) mta.text $1 $mta.nick($1,$2) Has Returned To The Game!
  elseif ($3 == !wb) mta.text $1 Welcome Back!
  elseif ($3 == !mapcount) mta.pm $1 $2 The Servers Current Map Count Is $mta.races($1)
  elseif ($3 == !mapname) mta.pm $1 $2 The Current Map Name Is $mta.race($1)
  elseif ($3 == !server) {
    mta.pm $1 $2 You are Playing At Sweet Mary Jane's! Hosted By X-Serverz.com!
    mta.pm $1 $2 IP:Port - $mta.server($1)
  }
  elseif ($3 == !reset) {
    if ($mta.level($1,$2) >= 3) {
      mta.text $1 Script Resetting Now...
      mta.disconnect $1
    }
  }
  elseif ($3 == !sleep) {
    if ($mta.level($1,$2) >= 2) {
      if ($readini(sweetmaryjane.ini,SLEEP,PLAYER)) mta.pm $1 $2 Error - Sleep Check Already In Progress...
      elseif (%a == -1) mta.pm $1 $2 Error - Invalid Nick...
      elseif (%a == $2) mta.pm $1 $2 Error - You Can't Accuse Yourself Of Sleeping...
      else {
        mta.text $1  A sleep check has been initiated On $mta.nick($1,%a)
        sleep.start $1 %a
      }
    }
  }
}
alias getid {
  var %a = 0  
  while (%a <= $mta.server($1).players) {
    if ($+(*,$2,*) iswm $mta.nick($1,%a)) !return %a
    !inc %a
  }  
  !return -1
}
alias disconnect {  
  !remini -n sweetmaryjane.ini STATUS
  .timer 1 2 mta.connect $1
}
alias connect {
  set %alive 0
  set %dead 0
  set %deaths 0
  set %ghosts 0
  set %mode N/A
  !remini -n sweetmaryjane.ini STATUS
  mta.text $1 Script Reconnected...
}
alias join {
  set %ghosts $calc(%ghosts + 1)
  !writeini -n sweetmaryjane.ini STATUS $mta.nick($1,$2) GHOST
  if ($mta.nick($1,$2) == Player) {
    .timer 1 1 mta.pm $1 $2 The Nick "Player" Is Forbiddenn In This Server. 30 Seconds To Change Your Nick Before Auto-Kick.
    .timer 1 29 checknick $1-
  }
  else mta.pm $1 $2 Welcome $mta.nick($1,$2) To Sweet Mary Jane's! Use !commands For Your Available Commands.
}
alias death {  
  set %alive $calc(%alive - 1)
  set %dead $calc(%dead + 1)
  set %deaths $calc(%deaths + 1)
  !writeini -n sweetmaryjane.ini STATUS $mta.nick($1,$2) DEAD
}
alias respawn {
  if (%mode == DM) {
    set %mode RSDM
  }
  if (GHOST isin $readini(sweetmaryjane.ini,STATUS,$mta.nick($1,$2))) {
    set %ghosts $calc(%ghosts - 1)
    set %alive $calc(%alive + 1)
    !writeini -n sweetmaryjane.ini STATUS $mta.nick($1,$2) ALIVE  
  }
  elseif (DEAD isin $readini(sweetmaryjane.ini,STATUS,$mta.nick($1,$2))) {
    set %alive $calc(%alive + 1)
    set %dead $calc(%dead - 1)
    !writeini -n sweetmaryjane.ini STATUS $mta.nick($1,$2) ALIVE  
  }
}
alias part {
  if ($2 = %vote.nick. [ $+ [ $1 ] ]) cancel.votekick $
  if ($mta.nick($1,$2) == $readini(sweetmaryjane.ini,SLEEP,PLAYER)) sleep.rem
  if (GHOST isin $readini(sweetmaryjane.ini,STATUS,$mta.nick($1,$2))) {
    set %ghosts $calc(%ghosts - 1)
    !writeini -n sweetmaryjane.ini STATUS $mta.nick($1,$2) PARTED  
  }
  elseif (ALIVE isin $readini(sweetmaryjane.ini,STATUS,$mta.nick($1,$2))) {
    set %alive $calc(%alive - 1)
    set %dead $calc(%dead + 1)
    set %deaths $calc(%deaths + 1)
    !writeini -n sweetmaryjane.ini STATUS $mta.nick($1,$2) PARTED  
  }
  elseif (DEAD isin $readini(sweetmaryjane.ini,STATUS,$mta.nick($1,$2))) {
    !writeini -n sweetmaryjane.ini STATUS $mta.nick($1,$2) PARTED  
  }
}
alias startrace {
  set %alive $mta.server($1).players
  set %dead 0
  set %deaths 0
  set %ghosts 0
  set %mode DM
  !remini -n sweetmaryjane.ini STATUS
  if (%alive <= $mta.server($1).players) {
    var %a = 0
    while (%a <= $mta.server($1).players) {
      if ($mta.nick($1,%a) != Unknown) {
        !writeini -n sweetmaryjane.ini STATUS $mta.nick($1,%a) ALIVE
      }      
      !inc %a
    }
  }
}
alias survivors {
  if (%mode == DM) {
    if (%alive == 1) {
      var %a = 0
      while (%a <= $mta.server($1).players) {
        if ($mta.nick($1,%a) != Unknown) {
          mta.text $1 $mta.nick($1,%a) Has Survived " $+ $mta.race($1) $+ " And Earned %dead Points!
          !writeini -n sweetmaryjane.ini POINTS $mta.nick($1,%a) $calc($points($1,%a) + %dead)
          !halt
        }      
        !inc %a  
      }
    }      
  }
  elseif (%mode == RSDM) {
    if (%alive == 1) {  
      var %a = 0
      while (%a <= $mta.server($1).players) {
        if ($mta.nick($1,%a) != Unknown) {
          mta.text $1 $mta.nick($1,%a) Is Currently The Only Player Alive! %deaths Points Awarded!
          !writeini -n sweetmaryjane.ini POINTS $mta.nick($1,%a) $calc($points($1,%a) + %deaths)
          !halt
        }  
        !inc %a            
      }
    }
  }
}
alias cancel.votekick {
  mta.text $1 Vote Kick Has Been Cancelled. $mta.nick($1,%vote.nick. [ $+ [ $1 ] ])
  unset %vote.nick. [ $+ [ $1 ] ]
Link to comment

Not being able to edit my post's is riduclas....

I am having a ID issue with my script,,,

when a player leaves the server, the script doesnt

display the nick properly when points are given.

Can anyone help me out with this?

And 1 other question...

on signal respawn is not listed in mta ma documentation, but it works fine,,,

are there other signals not in the docs?

Link to comment

one or two i guess, mta.finish seemed to work better for me than mta.endrace, not sure how it is nowdyays.

i still use mta.finish. i know thats not in my scripting.html list, also, mta.respawn.

not sure if theres any others tho.

Havent had time to look thru the entire script yet, looks like u seem to know what ur doing tho.

u might want to add an extra line or 2 to do some more checks on some of the admin commands,

like !ban, u might want to add a few user friendly lines also make it so u cant accidentally ban yourself.

the usual format would check admin level, check if id is you/them/unknown, then do the command. giving off the relevant error msgs if needed.

if i get time later i'll take a look at ur script in more detail.

Link to comment

O.k. things have changed.

A little cleaner, and a little better...

Here it is.

  
;
;=====================================================================================
; v 0.0.1
;
; Level = Rank = Commands Available
; 0 = Player = !brb,!back,!wb,!mapcount,!mapname,!server,!script,
; 1 = VIP = !admins,!votekick,!sleeper,
; 2 = Junior-Admin = !kick,!tf,!tm,
; 3 = Basic-Admin = !getip,!tbname,!tbip,!mute,!unmute,!freeze,!unfreeze,!newmap,!reset,
; 4 = Advanced-Admin = !banip,!unbanip,!banname,!unbanname,!remmep,
; 5 = Super-Admin =
;
;=====================================================================================
;
alias join {
  if $mta.nick($1,$2) isin $readini(sweetmaryjane.ini,NAMEBANS,BANNED) {
    mta.pm $1 $2 The Nick " $+ $mta.nick($1,$2) $+ " Is Banned On This Server.
    mta.kick $1 $2
  }
  elseif ($mta.nick($1,$2) == Player) {
    mta.pm $1 $2 The Nick " $+ $mta.nick($1,$2) $+ " Is Forbiddenn In This Server. 30 Seconds To Change Your Nick Before Auto-Kick.
    .timernp 1 5 check.nick.player $1-
  }
  else mta.pm $1 $2 Welcome $mta.nick($1,$2) To Sweet Mary Jane's! Use !commands For Your Available Commands.
}
alias part {
  if ($2 = %vote.nick. [ $+ [ $1 ] ]) cancel.votekick $
  if ($mta.nick($1,$2) == $readini(sweetmaryjane.ini,SLEEP,PLAYER)) sleep.rem
}
alias startrace {
  if $mta.race($1) isin $readini(sweetmaryjane.ini,REMMAPS,REMMAPS) {
    mta.startrace $1 $rand(0,$mta.races($1))
    .timerrm 1 1 mta.text $1 " $+ $mta.race($1) $+ " Did Not Play Because It Was Removed From The Map List.
  }
}
alias check.nick.player {
  if ($mta.nick($1,$2) == Player) mta.kick $1 $2
}
alias admin.count {
  var %a = 0, %b = None
  while (%a < $mta.server($1).players) {
    if ($mta.nick($1,%a) != $null) {
      if ($mta.level($1,%a) >= 3) {
        if (%b == None) %b = $mta.nick($1,%a) $+ ( $+ $mta.level($1,%a) $+ )
        else %b = %b $+ , $mta.nick($1,%a) $+ ( $+ $mta.level($1,%a) $+ )
      }
    }
    !inc %a
  }
  mta.pm $1 $2 Currently Logged In Admins: %b $+
}
alias get.id {
  var %id = 0  
  while (%id <= $mta.server($1).players) {
    if ($+(*,$2,*) iswm $mta.nick($1,%id)) !return %id
    !inc %id
  }  
  !return -1
}
alias get.ip {
  var %id = $iif($4,$iif($mta.nick($1,$4) != $null,$4,$get.id($1,$4)),$2)
  if (%id == -1) mta.pm $1 $2 Error - Invalid Nick.
  else mta.pm $1 $2 " $+ $mta.nick($1,%id) $+ 's" IP Is $mta.ip($1,%id)
}
alias ban.ip {
  if (*.*.*.* iswm $4) {
    mta.addban $1 $4
    mta.pm $1 $2 IP - $4 Has Been Added To The Ban List.
  }
  else mta.pm $1 $2 Error - No IP Specified.
}
alias ban.name {
  var %list = $iif($readini(sweetmaryjane.ini,NAMEBANS,BANNED),$v1)
  var %id = $iif($4,$iif($mta.nick($1,$4) != $null,$4,$get.id($1,$4)),$2)
  if (%id == -1) mta.pm $1 $2 Error - Invalid Nick.
  elseif ($mta.nick($1,%id) != $mta.nick($1,$2)) {
    !writeini -n sweetmaryjane.ini NAMEBANS BANNED $iif(%list,$v1 $+ $chr(44) $+ $chr(32)) $+ $mta.nick($1,%id)
    mta.pm $1 $2 The Nick " $+ $mta.nick($1,%id) $+ " Has Been Added To The Ban List.
    mta.kick $1 %id
  }
  else mta.pm $1 $2 Error - You Can't Ban A Name That You Are Currently Using.
}
alias temp.ban.ip {
  if (*.*.*.* iswm $4) {
    mta.addban $1 $4
    mta.text $1 The IP $4 Has Been Temporarily Added To The Ban List.
    .timertb 1 600 mta.unban $1 $4
    .timertb 1 600 mta.text $1 The Temporary Ban On IP $4 Has Expired. The IP Has Been Removed From The Ban List.
  }
  else mta.pm $1 $2 Error - Invalid IP.
}
alias temp.ban.name {
}
alias temp.mute {
  var %id = $iif($4,$iif($mta.nick($1,$4) != $null,$4,$get.id($1,$4)),$2)
  if (%id == -1) mta.pm $1 $2 Error - Invalid Nick.
  else {
    .timertm 1 15 mta.unmute $1 %id
    mta.mute $1 %id
  }
}
alias temp.freeze {
  var %id = $iif($4,$iif($mta.nick($1,$4) != $null,$4,$get.id($1,$4)),$2)
  if (%id == -1) mta.pm $1 $2 Error - Invalid Nick.
  else {
    .timertm 1 15 mta.unfreeze $1 %id
    mta.freeze $1 %id
  }
}
alias un.ban.ip {
  if (*.*.*.* iswm $4) {
    mta.unban $1 $4
    mta.pm $1 $2 IP - $4 Has Been Removed From Ban List.
  }
  else mta.pm $1 $2 Error - No IP Specified.
}
alias un.ban.name {
}
alias kick.name {
  var %id = $iif($4,$iif($mta.nick($1,$4) != $null,$4,$get.id($1,$4)),$2)
  if (%id == -1) mta.pm $1 $2 Error - Invalid Nick.
  else mta.kick $1 %id
}
alias start.vote.kick {
  var %id = $iif($4,$iif($mta.nick($1,$4) != $null,$4,$get.id($1,$4)),$2)
  if (%vote.nick. [ $+ [ $1 ] ] != $null) mta.pm $1 $2 Another Votekick Is Currently Running On $mta.nick($1,%vote.nick. [ $+ [ $1 ] ])
  elseif ($mta.server($1).players < 3) mta.pm $1 $2 Error - There Must Be At Least 3 Players In The Server To Start A Votekick.
  elseif (%id == -1) mta.pm $1 $2 Error - Invalid Nick.
  else {
    set %vote.nick. [ $+ [ $1 ] ] %id
    unset %vote.voters. [ $+ [ $1 ] ]
    mta.text $1 Type "!vote" If You Think $mta.nick($1,%id) Should Be Kicked. [ $round($calc($mta.server($1).players / 2),0) votes needed] [1 minute]
    .timervote [ $+ [ $1 ] ] 1 60 cancel.vote.kick $1
  }
}
alias cancel.vote.kick {
  mta.text $1 Vote Kick On $mta.nick($1,%vote.nick. [ $+ [ $1 ] ]) Has Been Cancelled.
  unset %vote.nick. [ $+ [ $1 ] ]
  unset %vote.voters. [ $+ [ $1 ] ]
}
alias start.sleep {
  var %id = $iif($4,$iif($mta.nick($1,$4) != $null,$4,$get.id($1,$4)),$2)
  if ($readini(sweetmaryjane.ini,SLEEP,PLAYER)) mta.pm $1 $2 Error - Sleep Check Already In Progress...
  elseif (%id == -1) mta.pm $1 $2 Error - Invalid Nick.
  else {
    mta.text $1  A sleep check has been initiated On " $+ $mta.nick($1,%id) $+ "
    sleep.start $1 %id
  }
}
alias sleep.start {
  !writeini -n sweetmaryjane.ini SLEEP PLAYER $mta.nick($1,$2)
  .timer -m 1 1000 mta.pm $1 $2 You Are Accused Of Sleeping...(AFK).
  .timer -m 1 1500 mta.pm $1 $2 To Avoid Being Kicked, You Must Type Something Within 15 Seconds!!!
  .timersleep 1 15 sleep.kick $1 $2
}
alias sleep.check {
  if ($mta.nick($1,$2) == $readini(sweetmaryjane.ini,SLEEP,PLAYER)) {
    mta.text $1 Sleep Kicker Has Been Deactivated.
    !remini -n sweetmaryjane.ini SLEEP
    .timersleep off
  }
}
alias sleep.kick {
  if ($mta.nick($1,$2) != Unknown) {
    mta.text $1 Kicking " $+ $mta.nick($1,$2) $+ " For Sleeping...(AFK).
    .timersk -m 2 1 mta.kick $1 $2
  }
}
alias sleep.rem {
  !remini -n sweetmaryjane.ini SLEEP
  .timersleep off
}
alias remove.map {
  if $mta.race($1) == Unknown {
    mta.text $1 Error - Map Name "Unknown". Unable To Remove. Starting Random Map Now.
    .timer 1 1 mta.startrace $1 $rand(0,$mta.races($1))
  }
  else {
    var %list = $iif($readini(sweetmaryjane.ini,REMMAPS,REMMAPS),$v1)
    !writeini -n sweetmaryjane.ini REMMAPS REMMAPS $iif(%list,$v1 $+ $chr(44) $+ $chr(32)) $+ $mta.race($1)
    mta.text $1 $mta.race($1) Has Been Removed From The Play List. Starting Random Map Now.
    .timer 1 1 mta.startrace $1 $rand(0,$mta.races($1))
  }
}
alias new.map {
  .timernm 1 1 mta.startrace $1 $rand(0,$mta.races($1))
  mta.text $1 Starting Random Map...
}
alias script.reset {
  mta.disconnect $1
  .timersc 1 1 mta.connect $1
  .timerrs 1 2 mta.text $1 Script Successfully Reset.
}
alias server {
  mta.pm $1 $2 You are Playing On Sweet Mary Jane's Server! Hosted By X-Serverz.com!
  mta.pm $1 $2 IP:Port - $mta.server($1)
}
;
;End Of Alias'
;===================================================================================================
;Beginning Of Signals
;
on *:SIGNAL:mta.command: {
  ;This event is triggered when a player does a !-command (e.g !test).
  ;Parameters: $1 = Server, $2 = PlayerID, $3 = Command, $4- = Parameters
  var %id = $iif($4,$iif($mta.nick($1,$4) != $null,$4,$get.id($1,$4)),$2)
  if ($3 == !commands) {
    mta.pm $1 $2 Your Available Player Commands Are:
    mta.pm $1 $2 !commands, !brb, !wb, !mapcount, !mapname, !server, !script,
    if ($mta.level($1,$2) == 1) {
      mta.pm $1 $2 Your Available Admin Commands Are:
      mta.pm $1 $2 !admins, !votekick, !sleeper,
    }
    if ($mta.level($1,$2) == 2) {
      mta.pm $1 $2 Your Available Admin Commands Are:
      mta.pm $1 $2 !admins, !votekick, !sleeper, !kick, !tf, !tm,
    }
    if ($mta.level($1,$2) == 3) {
      mta.pm $1 $2 Your Available Admin Commands Are:
      mta.pm $1 $2 !admins, !votekick, !sleeper, !kick, !tf, !tm, !getip, !tbname, !tbip, !mute, !unmute, !freeze, !unfreeze, !newmap, !reset,
    }
    if ($mta.level($1,$2) == 4) {
      mta.pm $1 $2 Your Available Admin Commands Are:
      mta.pm $1 $2 !admins, !votekick, !sleeper, !kick, !tf, !tm, !getip, !tbname, !tbip, !mute, !unmute, !freeze, !unfreeze, !newmap, !reset, !banip, !unbanip, !banname, !unbanname, !remmap,
    }
    if ($mta.level($1,$2) == 5) {
      mta.pm $1 $2 Your Available Admin Commands Are:
      mta.pm $1 $2 !admins, !votekick, !sleeper, !kick, !tf, !tm, !getip, !tbname, !tbip, !mute, !unmute, !freeze, !unfreeze, !newmap, !reset, !banip, !unbanip, !banname, !unbanname, !remmap,
    }
  }
  if ($3 == !brb) mta.text $1 $mta.nick($1,$2) Will Be Right Back! $iif($4, Reason: $4-)
  if ($3 == !back) mta.text $1 $mta.nick($1,$2) Has Returned To The Game!
  if ($3 == !wb) mta.text $1 $iif((!$4),Welcome Back!,Welcome Back $mta.nick($1,%id) $+ !)
  if ($3 == !mapcount) mta.pm $1 $2 The Servers Current Map Count Is $mta.races($1)
  if ($3 == !mapname) mta.pm $1 $2 The Current Map Name Is $mta.race($1)
  if ($3 == !server) server $1-
  if ($3 == !script) mta.pm $1 $2 Sweet Mary Jane's Server Is Running The [sMJ] Script By [sMJ]4:20.
  if ($3 == !admins) && ($mta.level($1,$2) >= 1) admin.count $1-
  if ($3 == !votekick) && ($mta.level($1,$2) >= 1) start.vote.kick $1-
  if ($3 == !sleeper) && ($mta.level($1,$2) >= 1) start.sleep $1-
  if ($3 == !kick) && ($mta.level($1,$2) >= 2) kick.name $1-
  if ($3 == !tf) && ($mta.level($1,$2) >= 2) temp.freeze $1-
  if ($3 == !tm) && ($mta.level($1,$2) >= 2) temp.mute $1-
  if ($3 == !getip) && ($mta.level($1,$2) >= 3) get.ip $1-
  if ($3 == !tbname) && ($mta.level($1,$2) >= 3) temp.ban.name $1-
  if ($3 == !tbip) && ($mta.level($1,$2) >= 3) temp.ban.ip $1-
  if ($3 == !mute) && ($mta.level($1,$2) >= 3) mta.mute $1 %id
  if ($3 == !unmute) && ($mta.level($1,$2) >= 3) mta.unmute $1 %id
  if ($3 == !freeze) && ($mta.level($1,$2) >= 3) mta.freeze $1 %id`
  if ($3 == !unfreeze) && ($mta.level($1,$2) >= 3) mta.unfreeze $1 %id
  if ($3 == !newmap) && ($mta.level($1,$2) >= 3) new.map $1-
Link to comment
Do you know the parameters for mta.finish?

They all are in scripting.html that goes with mtama.

.timer 1 15 if ($mta.nick($1,$2) == Player) mta.kick $1 $2

If you want to check after 15 seconds, you have to put it into an alias and call the alias, cause everything put in the timer line is parsed instantly and only executed/shown after

There's an

$iif(condition,if condition do this[,if not do this]) 

like 'mta.text $1 $iif($mta.nick($1,$2) == lil_Toady,$mta.nick($1,$2) ownz!,$mta.nick($1,$2) sux!)'

Link to comment

Im having trouble with these two lines..

elseif ($5 != (1 || 2 || 3 || 4 || 5 || 6 || 7 || 8 || 9 || 10 || 1337)) mta.pm $1 $2 Error - Invalid Level.

elseif ($6 != ACTIVE || INACTIVE) mta.pm $1 $2 Error - Invalid Status.

mirc saying ambiguous format

i think its saying im being presumptious in assuming there will be a $5 and a $6

but doesnt my statement say if not then ?

mirc says this wether there is $5 and or $6 or not.

Thanks for your time

4:20

Link to comment
Im having trouble with these two lines..

elseif ($5 != (1 || 2 || 3 || 4 || 5 || 6 || 7 || 8 || 9 || 10 || 1337)) mta.pm $1 $2 Error - Invalid Level.

elseif ($6 != ACTIVE || INACTIVE) mta.pm $1 $2 Error - Invalid Status.

mirc saying ambiguous format

i think its saying im being presumptious in assuming there will be a $5 and a $6

but doesnt my statement say if not then ?

mirc says this wether there is $5 and or $6 or not.

Thanks for your time

4:20

u will need to add the { }'s for it to work if u add it all between an external set of brackets(some people dont use the external ones)

also, u need to ask each one individually,

elseif (($5 != 1) || ($5 != 2) || ($5 != 3) || and so on)

or u could do:

elseif (($5 < 1) || ($5 > 10) && ($5 != 1337)) {

if its just to see if someone has admin, elseif ($5 != 0) would be the best way.

Link to comment

You should remove the un-used signals, although they are harmless, they do make the script alot shorter...

And you should upgrade to my new DM Script, its alot better... That script does work but its somehow slow and sometimes says the wrong name as winner, and i have no idea why :o also i would suggest not using alias's too much, they make things alot slower, you should use aliases as less as possible!

Link to comment
You should remove the un-used signals, although they are harmless, they do make the script alot shorter...

And you should upgrade to my new DM Script, its alot better... That script does work but its somehow slow and sometimes says the wrong name as winner, and i have no idea why :o also i would suggest not using alias's too much, they make things alot slower, you should use aliases as less as possible!

in previous scripts ive made, using 'alises' to reduce the size of the mta.command alias has reduced the speed dramatically.

i was told years ago that mirc parses the aliases on start but ive been unable to clarify if this is true.

of course the aliases from the signals are pointless and would slow the script(when i say slow down, this is so tiny u wouldnt notice it) but the commands can be written directly to the signals.

some things in scripts will speed them up a lot, also, some are such a minute difference that u wouldnt notice it over 1 line, but as a whole, its best to do all u can to make it run as fast as possible. most of us dont do this in general scripts because of laziness,

but theres usually always room to improve scripts, i would recommend u keep ur aliases, but lose the ones that are unneeded.

Link to comment

Wow, Thanks for the reply's guys!

I realized my errors with help from [XE]Tommis, but I

really appreciate you help guys!

Well, like very often, I started over again. I need to get

the remove/temp vip and remove and temp bannames

working, as well as a is vip online, but everything else

seems to works well... I think,

Here it is...

  
;=====================================================
; Sweet Mary Jane's Script For MTA:SA mIRC Admin 4.15   
;                              ~version 0.1~           
;=====================================================
alias get.id {
  var %id = 0  
  while (%id <= 32) {
    if ($+(*,$2,*) iswm $mta.nick($1,%id)) !return %id
    !inc %id
  }  
  !return -1
}
alias get.ip {
  if ($mta.level($1,$2) < 3) mta.pm $1 $2 You Can Only Check A Players IP Address IF You Are Logged In As A RCON Admin Level 3 Or Higher.
  else {
    var %id = $iif($4,$iif($mta.nick($1,$4) != $null,$4,$get.id($1,$4)),$2)
    if (%id == -1) mta.pm $1 $2 Error - Invalid Nick.
    elseif ($4 == $null) mta.pm $1 $2 Error - Nick Not Present. You Must Enter A Nick.
    else mta.pm $1 $2 $mta.nick($1,%id) $+ 's IP Address Is $mta.ip($1,%id)
  }
}
alias banned.nick.check {
  if ($mta.nick($1,$2) isin $readini(sweetmaryjane.ini,NAMEBANS,BANNED)) {
    mta.pm $1 $2 The Nick " $+ $mta.nick($1,$2) $+ " Is Banned On This Server.
    mta.pm $1 $2 Feel Free To Come Back After You Change Your Nick.
    .timer 1 2 mta.kick $1 $2
  }
  else player.nick.check $1-
}
alias player.nick.check {
  if ($mta.nick($1,$2) == Player) {
    mta.pm $1 $2 The Nick "Player" Is Too Common And Is Forbiddenn In This Server.
    mta.pm $1 $2 60 Seconds To Change Your Nick Before Auto-Kick.
    mta.pm $1 $2 ~This Is Your First Warning!~
    .timer 1 20 player.nick.warning.two $1-
  }
  else {
    mta.pm $1 $2 Welcome $mta.nick($1,$2) To [sMJ] Sweet Mary Jane's!
    mta.pm $1 $2 Use !commands For Your Available Commands.
  }
}
alias player.nick.warning.two {
  if ($mta.nick($1,$2) == Player) {
    mta.pm $1 $2 The Nick "Player" Is Too Common And Is Forbiddenn In This Server.
    mta.pm $1 $2 40 Seconds To Change Your Nick Before Auto-Kick.
    mta.pm $1 $2 ~This Is Your Second Warning!~
    .timer 1 20 player.nick.warning.three $1-
  }
}
alias player.nick.warning.three {
  if ($mta.nick($1,$2) == Player) {
    mta.pm $1 $2 The Nick "Player" Is Too Common And Is Forbiddenn In This Server.
    mta.pm $1 $2 20 Seconds To Change Your Nick Before Auto-Kick.
    mta.pm $1 $2 ~This Is Your Third Warning!~
    .timer 1 20 player.nick.kick $1-
  }
}
alias player.nick.kick {
  if ($mta.nick($1,$2) == Player) {
    mta.pm $1 $2 You Have Been Warned Three Times To Change Your Nick.
    mta.pm $1 $2 Feel Free To Come Back After You Change Your Nick.
    .timer 1 1 mta.kick $1 $2
  }
}
alias admin.online.check {
  if ($mta.level($1,$2) < 1) mta.pm $1 $2 You Can Only Check For Online RCON Admins IF You Are Logged In As A RCON Admin.
  else {
    var %a = 0, %b = None
    while (%a <= 32) {
      if ($mta.level($1,%a) >= 1) {
        if (%b == None) %b = $mta.nick($1,%a) $+ ( $+ $mta.level($1,%a) $+ )
        else %b = %b $+ , $mta.nick($1,%a) $+ ( $+ $mta.level($1,%a) $+ )
      }
      !inc %a
    }
    mta.pm $1 $2 Currently Logged In RCON Admins: %b $+
  }
}
alias vip.online.check {
}
alias add.vip.admin {
  if ($mta.level($1,$2) < 4) mta.pm $1 $2 You Can Only Add A VIP Admin IF You Are Logged In As A RCON Admin Level 4 Or Higher.
  else {
    var %id = $iif($4,$iif($mta.nick($1,$4) != $null,$4,$get.id($1,$4)),$2)
    var %vip = $iif($readini(sweetmaryjane.ini,ADMINS,VIP),$v1)
    if (%id == -1) mta.pm $1 $2 Error - Invalid Nick. The Player Being Added As VIP Admin MUST Currently Be On The Server.
    elseif ($4 == $null) mta.pm $1 $2 Error - Nick Not Present. You Must Enter A Nick.
    else {
      !writeini -n sweetmaryjane.ini ADMINS VIP $iif(%nban,$v1 $+ $chr(44) $+ $chr(32)) $+ $mta.nick($1,%id)
      mta.pm $1 $2 You Have Added $mta.nick($1,%id) As A VIP Admin.
      mta.pm $1 %id You Have Been Added As A VIP Admin By $mta.nick($1,$2) $+ .
    }
  }
}
alias remove.vip.admin {
  if ($mta.level($1,$2) < 4) mta.pm $1 $2 You Can Only Remove A VIP Admin IF You Are Logged In As A RCON Admin Level 4 Or Higher.
  else {
    var %id = $iif($4,$iif($mta.nick($1,$4) != $null,$4,$get.id($1,$4)),$2)
    if (%id == -1) mta.pm $1 $2 Error - Invalid Nick.
    elseif ($4 == $null) mta.pm $1 $2 Error - Nick Not Present. You Must Enter A Nick.
    else {
      !remini -n sweetmaryjane.ini ADMINS VIP $mta.nick($1,%id) $+ ,
      mta.pm $1 $2 You Have Removed $mta.nick($1,%id) As A VIP Admin.
      mta.pm $1 %id You Have Been Removed As A VIP Admin By $mta.nick($1,$2) $+ .
    }
  }
}
alias temp.vip.admin {
}
alias ban.name {
  if ($mta.level($1,$2) < 4) mta.pm $1 $2 You Can Only Ban A Permanently Ban A Nick IF You Are Logged In As A RCON Admin Level 4 Or Higher.
  else {
    var %nban = $iif($readini(sweetmaryjane.ini,NAMEBANS,BANNED),$v1)
    var %id = $iif($4,$iif($mta.nick($1,$4) != $null,$4,$get.id($1,$4)),$2)  
    if (%id == -1) mta.pm $1 $2 Error - Invalid Nick.
    elseif ($4 == $null) mta.pm $1 $2 Error - Nick Not Present. You Must Enter A Nick.
    elseif ($mta.nick($1,%id) == $mta.nick($1,$2)) mta.pm $1 $2 Error - You Can't Ban A Nick That You Are Currently Using.
    else {
      !writeini -n sweetmaryjane.ini NAMEBANS BANNED $iif(%nban,$v1 $+ $chr(44) $+ $chr(32)) $+ $mta.nick($1,%id)
      mta.pm $1 $2 The Nick " $+ $mta.nick($1,%id) $+ " Has Been Added To The Ban List.
      mta.pm $1 %id The Nick " $+ $mta.nick($1,%id) $+ " Has Just Been Banned By $mta.nick($1,$2) $+ . Feel Free To Come Back With A Different Nick.
      mta.kick $1 %id
    }
  }
}
alias un.ban.name {
  if ($mta.level($1,$2) < 4) mta.pm $1 $2 You Can Only Remove A VIP Admin IF You Are Logged In As A RCON Admin Level 4 Or Higher.
  else {
    var %id = $iif($4,$iif($mta.nick($1,$4) != $null,$4,$get.id($1,$4)),$2)    
    if (%id == -1) mta.pm $1 $2 Error - Invalid Nick.
    elseif ($4 == $null) mta.pm $1 $2 Error - Nick Not Present. You Must Enter A Nick.
    else {
      !remini -n sweetmaryjane.ini NAMEBANS BANNED $mta.nick($1,%id) $+ ,
      mta.pm $1 $2 You Have Removed $mta.nick($1,%id) As A VIP Admin.
      mta.pm $1 %id You Have Been Removed As A VIP Admin By $mta.nick($1,$2) $+ .
    }
  }
}
alias temp.ban.name {
}
alias restart.server {
  if ($mta.level($1,$2) < 5) mta.pm $1 $2 You Can Only Restart The Server IF You Are Logged In As A RCON Admin Level 5.
  else {
    mta.text $1 The Server Is Being Reset And Will Be Back Online Within 10 Seconds.
    mta.text $1 The Server Is Shutting Down Now.
    .timer 1 1 mta.shutdown $1
  }
}
alias reset.script {
  if ($mta.level($1,$2) < 4) mta.pm $1 $2 You Can Only Reset The Script IF You Are Logged In As A RCON Admin Level 4 Or Higher.
  else {
    mta.text $1 The Script Is Being Reset And Will Be Reconnected Within 5 Seconds.
    .timer 1 1 mta.disconnect $1
    .timer 1 3 mta.connect $1
    .timer 1 5 mta.text $1 The Script Has Been Successfully Reset And Reconnected.
  }
}
alias ban.ip {
  if ($mta.level($1,$2) < 4) mta.pm $1 $2 You Can Only Ban A IP Address IF You Are Logged In As A RCON Admin Level 4 Or Higher.
  else {
    if (*.*.*.* iswm $4) {
      mta.addban $1 $4
      mta.pm $1 $2 The IP Address $4 Has Been Added To The Ban List.
    }
    else mta.pm $1 $2 Error - No IP Specified.
  }
}
alias un.ban.ip {
  if ($mta.level($1,$2) < 4) mta.pm $1 $2 You Can Only Un-Ban A IP Address IF You Are Logged In As A RCON Admin Level 4 Or Higher.
  else {
    if (*.*.*.* iswm $4) {
      mta.unban $1 $4
      mta.pm $1 $2 IP - $4 Has Been Removed From Ban List.
    }
    else mta.pm $1 $2 Error - No IP Specified.
  }
}
alias temp.ban.ip {
  if ($mta.level($1,$2) < 3) mta.pm $1 $2 You Can Only Temp-Ban A IP Address IF You Are Logged In As A RCON Admin Level 3 Or Higher.
  else {
    if (*.*.*.* iswm $4) {
      mta.addban $1 $4
      mta.text $1 The IP $4 Has Been Temporarily Added To The Ban List.
      .timer 1 600 mta.unban $1 $4
      .timer 1 600 mta.text $1 The Temporary Ban On IP $4 Has Expired. The IP Has Been Removed From The Ban List.
    }
    else mta.pm $1 $2 Error - Invalid IP.
  }
}
alias temp.freeze.name {
  if ($mta.level($1,$2) < 2) mta.pm $1 $2 You Can Only Temp-Freeze A Player IF You Are Logged In As A RCON Admin Level 2 Or Higher.
  else {
    var %id = $iif($4,$iif($mta.nick($1,$4) != $null,$4,$get.id($1,$4)),$2)
    if (%id == -1) mta.pm $1 $2 Error - Invalid Nick.
    elseif ($4 == $null) mta.pm $1 $2 Error - Nick Not Present. You Must Enter A Nick.
    else {
      mta.pm $1 %id You Have Been Temporarily Frozen By $mta.nick($1,$2) $+ .
      mta.pm $1 $2 You Have Temporarily Frozen $mta.nick($1,%id) $+ .
      .timer 1 15 mta.unfreeze $1 %id
      mta.freeze $1 %id
    }
  }
}
alias temp.mute.name {
  if ($mta.level($1,$2) < 2) mta.pm $1 $2 You Can Only Temp-Mute A Player IF You Are Logged In As A RCON Admin Level 2 Or Higher.
  else {
    var %id = $iif($4,$iif($mta.nick($1,$4) != $null,$4,$get.id($1,$4)),$2)
    if (%id == -1) mta.pm $1 $2 Error - Invalid Nick.
    elseif ($4 == $null) mta.pm $1 $2 Error - Nick Not Present. You Must Enter A Nick.
    else {
      mta.pm $1 %id You Have Been Temporarily Muted By $mta.nick($1,$2) $+ .
      mta.pm $1 $2 You Have Temporarily Muted $mta.nick($1,%id) $+ .
      .timer 1 15 mta.unmute $1 %id
      mta.mute $1 %id
    }
  }
}
alias freeze.name {
  if ($mta.level($1,$2) < 2) mta.pm $1 $2 You Can Only Freeze A Player IF You Are Logged In As A RCON Admin Level 2 Or Higher.
  else {
    var %id = $iif($4,$iif($mta.nick($1,$4) != $null,$4,$get.id($1,$4)),$2)
    if (%id == -1) mta.pm $1 $2 Error - Invalid Nick.
    elseif ($4 == $null) mta.pm $1 $2 Error - Nick Not Present. You Must Enter A Nick.
    else {
      mta.pm $1 $2 You Have Frozen $mta.nick($1,%id) $+ .
      mta.pm $1 %id You Have Been Frozen By $mta.nick($1,$2) $+ .
      mta.freeze $1 %id
    }
  }
}
alias un.freeze.name {
  if ($mta.level($1,$2) < 2) mta.pm $1 $2 You Can Only Un-Freeze A Player IF You Are Logged In As A RCON Admin Level 2 Or Higher.
  else {
    var %id = $iif($4,$iif($mta.nick($1,$4) != $null,$4,$get.id($1,$4)),$2)
    if (%id == -1) mta.pm $1 $2 Error - Invalid Nick.
    elseif ($4 == $null) mta.pm $1 $2 Error - Nick Not Present. You Must Enter A Nick.
    mta.pm $1 $2 You Have Un-Frozen $mta.nick($1,%id) $+ .
    mta.pm $1 %id You Have Been Un-Frozen By $mta.nick($1,$2) $+ .
    mta.unfreeze $1 %id
  }
}
alias mute.name {
  if ($mta.level($1,$2) < 2) mta.pm $1 $2 You Can Only Mute A Player IF You Are Logged In As A RCON Admin Level 2 Or Higher.
  else {
    var %id = $iif($4,$iif($mta.nick($1,$4) != $null,$4,$get.id($1,$4)),$2)
    if (%id == -1) mta.pm $1 $2 Error - Invalid Nick.
    elseif ($4 == $null) mta.pm $1 $2 Error - Nick Not Present. You Must Enter A Nick.
    mta.pm $1 $2 You Have Muted $mta.nick($1,%id) $+ .
    mta.pm $1 %id You Have Been Muted By $mta.nick($1,$2) $+ .
    mta.mute $1 %id
  }
Link to comment

So, I have written a points script, I tried to cover

all the bases. It's all pretty trivial but it dont

work LOL. mIRC isnt giving errors, so I am lost.

Here it is, any ideas?

I think I am messed up with the var's for player id's...

  
;===================================================== 
; Sweet Mary Jane's Script For MTA:SA mIRC Admin 4.15 
;                   ~version 0.1~points          
;===================================================== 
; 
alias get.id {  
  var %id = 0   
  while (%id <= 31) { 
    if ($+(*,$2,*) iswm $mta.nick($1,%id)) !return %id 
    !inc %id 
  }   
  !return -1 
} 
alias points.cash { 
  dm.points.cash $1- 
  rsdm.points.cash $1- 
} 
alias dm.points.cash { 
  if (%alive == 1) && (%mode == DM) { 
    var %a = 0  
    while (%a <= 31) { 
      if (ALIVE isin $current.status) { 
        mta.freeze $1 %a 
        !writeini -n sweetmaryjane.ini POINTS $mta.nick($1,%a) $calc($current.points($1,%a) + %dead) 
        !writeini -n sweetmaryjane.ini CASH $mta.nick($1,%a) $calc($current.cash($1,%a) + $calc(%dead * 500)) 
        !writeini -n sweetmaryjane.ini WINS $mta.nick($1,%a) $calc($total.wins($1,%a) + 1) 
        mta.text $1 $mta.nick($1,%a) Dominated $mta.race($1) $+ . %dead Points And $ $+ $calc(%dead * 500) Earned!. 
        mta.pm $1 %a You Now Have A Total Of $current.points And $current.cash $+ !.  
        !halt 
      } 
      !inc %a 
    } 
  } 
} 
alias rsdm.points.cash { 
  if (%alive == 1a&& (%mode == RSDM) { 
    var %b = 0 
    while (%b <= 31) { 
      if (ALIVE isin $current.status) { 
        !writeini -n sweetmaryjane.ini WINS $mta.nick($1,%a) $calc($current.wins($1,%a) + 1) 
        !writeini -n sweetmaryjane.ini POINTS $mta.nick($1,%b) $calc($current.points($1,%b) + %dead) 
        !writeini -n sweetmaryjane.ini CASH $mta.nick($1,%b) $calc($current.cash($1,%b) + $calc(%dead * 250)) 
        mta.text $1 $mta.nick($1,%b) Has Earned %dead Points And $ $+ $calc(%dead * 250) For Being The Only Player Currently Alive! 
        mta.pm $1 %b You Now Have A Total Of $current.points And $current.cash $+ !.  
        !halt 
      } 
      %inc %b 
    } 
  } 
} 
alias current.status $readini(sweetmaryjane.ini,STATUS,$mta.nick($1,$2))  
alias current.points !return $iif($readini(sweetmaryjane.ini,POINTS,$mta.nick($1,$2)),$v1,0) 
alias current.cash !return $iif($readini(sweetmaryjane.ini,CASH,$mta.nick($1,$2)),$v1,0) 
alias total.maps !return $iif($readini(sweetmaryjane.ini,LOSSES,$mta.nick($1,$2)),$v1,0) 
alias total.wins !return $iif($readini(sweetmaryjane.ini,WINS,$mta.nick($1,$2)),$v1,0) 
alias total.deaths !return $iif($readini(sweetmaryjane.ini,DEATHS,$mta.nick($1,$2)),$v1,0) 
;alias current.ratio !return $calc($total.maps / $total.wins) 
alias get.points { 
  if (%id == -1) mta.pm $1 $2 Error - Invalid Nick. No Player Found Matching That Nick. 
  elseif ($4 == $null) mta.pm $1 $2 Error - No Nick Entered. Please Enter A Nick. 
  elseif (%id == $2) mta.pm $1 $2 You Have A Total Of $iif($readini(smjpoints.ini,POINTS,$mta.nick($1,%a)),$v1,0) Points!. 
  else mta.pm $1 $2 $mta.nick($1,%id) Has A Total Of $iif($readini(smjpoints.ini,POINTS,$mta.nick($1,%a)),$v1,0) Points!.  
} 
alias get.cash { 
  if (%id == -1) mta.pm $1 $2 Error - Invalid Nick. No Player Found Matching That Nick. 
  elseif ($4 == $null) mta.pm $1 $2 Error - No Nick Entered. Please Enter A Nick. 
  elseif (%id == $2) mta.pm $1 $2 You Have A Total Of $ $+ $iif($readini(smjpoints.ini,CASH,$mta.nick($1,%a)),$v1,0) $+ . 
  else mta.pm $1 $2 $mta.nick($1,%id) Has A Total Of $ $+ $iif($readini(smjpoints.ini,CASH,$mta.nick($1,%a)),$v1,0) $+ .  
} 
alias get.stats { 
  if (%id == -1) mta.pm $1 $2 Error - Invalid Nick. No Player Found Matching That Nick. 
  elseif ($4 == $null) mta.pm $1 $2 Error - No Nick Entered. Please Enter A Nick. 
  elseif (%id == $2) { 
    mta.pm $1 $2 Your Stats Are: Have A Total Of $ $+ $iif($readini(smjpoints.ini,CASH,$mta.nick($1,%a)),$v1,0) $+ . 
    mta.pm $1 $2 Points: $current.points Cash: $current.cash Wins: $total.wins Deaths: $total.deaths Ratio: $current.ratio    
    else { 
      mta.pm $1 $2 $mta.nick($1,%id) $+ 's Stats Are: 
      mta.pm $1 $2 Points: $current.points Cash: $current.cash Wins: $total.wins Deaths: $total.deaths Ratio: $current.ratio  
    } 
  } 
} 
alias get.alive { 
  if (%alive == 1) mta.pm $1 $2 There Is Currently %alive Player Alive. 
  else mta.pm $1 $2 There Are Currently %alive Players Alive. 
} 
alias get.dead { 
  if (%dead == 1) mta.pm $1 $2 There Is Currently %dead Player Dead. 
  else mta.pm $1 $2 There Are Currently %dead Players Dead. 
} 
alias get.deaths { 
  if (%deaths == 1) mta.pm $1 $2 There Has Been %deaths Death So Far This Map. 
  else mta.pm $1 $2 There Have Been %deaths Deaths So Far This Map. 
} 
alias get.ghosts { 
  if (%ghosts == 1) mta.pm $1 $2 There Is Currently %ghosts Ghost Watching Over This Server. 
  else mta.pm $1 $2 There Are Currently %ghosts Ghosts Watching Over This Server. 
} 
alias get.players { 
  if (%stotal == 1) mta.pm $1 $2 You Are The Only Player In The Server! 
  else { 
    mta.pm $1 $2 There Are Currently %stotal Players In The Server! 
    if (%alive == 1) && (%dead == 1) && (%ghosts == 1) mta.pm $1 $2 %alive Player Alive / %dead Player Dead / %ghosts Ghost. 
    elseif (%alive != 1) && (%dead != 1) && ($ghosts != 1) mta.pm $1 $2 %alive Players Alive / %dead Players Dead / %ghosts Ghost. 
    elseif (%alive != 1) && (%dead == 1) && ($ghosts == 1) mta.pm $1 $2 %alive Players Alive / %dead Player Dead / %ghosts Ghost. 
    elseif (%alive == 1) && (%dead != 1) && ($ghosts == 1) mta.pm $1 $2 %alive Player Alive / %dead Players Dead / %ghosts Ghost. 
    elseif (%alive == 1) && (%dead == 1) && ($ghosts != 1) mta.pm $1 $2 %alive Player Alive / %dead Player Dead / %ghosts Ghosts. 
    elseif (%alive != 1) && (%dead != 1) && ($ghosts == 1) mta.pm $1 $2 %alive Players Alive / %dead Players Dead / %ghosts Ghost. 
    elseif (%alive == 1) && (%dead != 1) && ($ghosts != 1) mta.pm $1 $2 %alive Player Alive / %dead Players Dead / %ghosts Ghosts. 
    elseif (%alive != 1) && (%dead == 1) && ($ghosts != 1) mta.pm $1 $2 %alive Players Alive / %dead Player Dead / %ghosts Ghosts. 
  } 
} 
on *:SIGNAL:mta.command: { 
  var %id = $iif($4,$iif($mta.nick($1,$4) != $null,$4,$get.id($1,$4)),$2) 
  if ($3 == Points) get.points $1- 
  elseif ($3 == Cash) || ($3 == Money) get.cash $1- 
  elseif ($3 == Stats) get.stats $1- 
  elseif ($3 == Alive) get.alive $1- 
  elseif ($3 == Dead) get.dead $1- 
  elseif ($3 == Deaths) get.deaths $1- 
  elseif ($3 == Ghosts) get.ghosts $1- 
  elseif ($3 == Players) get.players $1- 
} 
on *:SIGNAL:mta.connect: { 
  set %alive N/A 
  set %ghosts N/A 
  set %dead N/A 
  set %deaths N/A 
  set %mtotal N/A 
  set %stotal $mta.server($1).players 
  set %mode DM 
} 
on *:SIGNAL:mta.join: { 
  !writeini -n sweetmaryjane.ini STATUS $mta.nick($1,$2) GHOST 
  %inc %stotal   
  if (%ghosts != N/A) %inc %ghosts  
} 
on *:SIGNAL:mta.startrace: { 
  set %alive $mta.server($1).players 
  set %ghosts 0 
  set %dead 0 
  set %deaths 0 
  set %mtotal $mta.server($1).players 
  set %mode DM 
  if (0 = 0) { 
    var %c = 0 
    while (%c <= 31) { 
      !writeini -n sweetmaryjane.ini STATUS $mta.nick($1,%c) ALIVE 
      !writeini -n sweetmaryjane.ini MAPS $mta.nick($1,%a) $calc($total.maps($1,%id) + 1) 
    } 
    !inc %c 
  } 
}  
on *:SIGNAL:mta.death: { 
  !writeini -n sweetmaryjane.ini STATUS $mta.nick($1,$2) DEAD 
  !writeini -n sweetmaryjane.ini DEATHS $mta.nick($1,%a) $calc($total.deaths($1,$2) + 1) 
  if (%mtotal != N/A) %dec %mtotal 
  if (%alive != N/A) %dec %alive 
  if (%dead != N/A) %inc %dead 
  if (%deaths != N/A) %inc %deaths  
} 
on *:SIGNAL:mta.respawn: { 
  !writeini -n sweetmaryjane.ini STATUS $mta.nick($1,$2) ALIVE 
  set %mode RSDM 
  if (%alive != N/A) %inc %alive 
  if (%dead != N/A) %dec %dead 
} 
on *:SIGNAL:mta.part: { 
  %dec stotal 
  if (ALIVE isin $current.status) { 
    !writeini -n sweetmaryjane.ini STATUS $mta.nick($1,$2) PARTED 
    if (%mtotal != N/A) %dec %mtotal 
    if (%alive != N/A) %dec %alive 
    if (%dead != N/A) %inc %dead 
    if (%deaths != N/A) %inc %deaths 
  }  
  elseif (DEAD isin $current.status) !writeini -n sweetmaryjane.ini STATUS $mta.nick($1,$2) PARTED   
  elseif (GHOST isin $current.status) { 
    !writeini -n sweetmaryjane.ini STATUS $mta.nick($1,$2) PARTED 
    if (%ghosts != N/A) %dec %ghosts 
  } 
} 
on *:SIGNAL:mta.finish: { 
  points.cash $1- 
} 
on *:SIGNAL:mta.endrace: { 
  points.cash $1- 
} 
on *:SIGNAL:mta.disconnect: { 
  remini -n sweetmaryjane.ini STATUS 
} 
  

Thanks for Anything!

Link to comment

line 23 and 40, at a glance, u have:

      if (ALIVE isin $current.status) { 

maybe the line should read:

      if (ALIVE isin $current.status($1,$2)) { 

i can see ur using isin too, im just not sure why ur not using ==

ok, ive just noticed a lot of ur identifiers like this one above, ur not sending the parameters > ($1,$2),

im guessing they wont be working properly either.

Link to comment

Ok, made modifications, now when i start new map mta ma crashes

Man I hate while loops.

I did what u said and I got this now.

  
;===================================================== 
; Sweet Mary Jane's Script For MTA:SA mIRC Admin 4.15 
;                        ~version 0.1~points 
;===================================================== 
; 
alias get.id {  
  var %id = 0   
  while (%id <= %stotal) { 
    if ($+(*,$2,*) iswm $mta.nick($1,%id)) !return %id 
    !inc %id 
  }   
  !return -1 
} 
alias points.cash { 
  dm.points.cash $1- 
  rsdm.points.cash $1- 
} 
alias dm.points.cash { 
  if (%alive == 1) && (%mode == DM) { 
    var %a = 0  
    while (%a <= %stotal) { 
      if (ALIVE == $current.status($1,%a)) { 
        mta.freeze $1 %a 
        !writeini -n sweetmaryjane.ini POINTS $mta.nick($1,%a) $calc($current.points($1,%a) + %dead) 
        !writeini -n sweetmaryjane.ini CASH $mta.nick($1,%a) $calc($current.cash($1,%a) + $calc(%dead * 500)) 
        !writeini -n sweetmaryjane.ini WINS $mta.nick($1,%a) $calc($total.wins($1,%a) + 1) 
        mta.text $1 $mta.nick($1,%a) Dominated $mta.race($1) $+ . %dead Points And $ $+ $calc(%dead * 500) Earned!. 
        mta.pm $1 %a You Now Have A Total Of $current.points($1,%a) And $current.cash($1,%a) $+ !.  
        !halt 
      } 
      !inc %a 
    } 
  } 
} 
alias rsdm.points.cash { 
  if (%alive == 1) && (%mode == RSDM) { 
    var %b = 0 
    while (%b <= %stotal) { 
      if (ALIVE == $current.status($1,%b)) { 
        !writeini -n sweetmaryjane.ini WINS $mta.nick($1,%b) $calc($current.wins($1,%b) + 1) 
        !writeini -n sweetmaryjane.ini POINTS $mta.nick($1,%b) $calc($current.points($1,%b) + %dead) 
        !writeini -n sweetmaryjane.ini CASH $mta.nick($1,%b) $calc($current.cash($1,%b) + $calc(%dead * 250)) 
        mta.text $1 $mta.nick($1,%b) Has Earned %dead Points And $ $+ $calc(%dead * 250) For Being The Only Player Currently Alive! 
        mta.pm $1 %b You Now Have A Total Of $current.points($1,%b) And $current.cash($1,%b) $+ !.  
        !halt 
      } 
      %inc %b 
    } 
  } 
} 
alias current.status $readini(sweetmaryjane.ini,STATUS,$mta.nick($1,$2))  
alias current.points !return $iif($readini(sweetmaryjane.ini,POINTS,$mta.nick($1,$2)),$v1,0) 
alias current.cash !return $iif($readini(sweetmaryjane.ini,CASH,$mta.nick($1,$2)),$v1,0) 
alias total.maps !return $iif($readini(sweetmaryjane.ini,LOSSES,$mta.nick($1,$2)),$v1,0) 
alias total.wins !return $iif($readini(sweetmaryjane.ini,WINS,$mta.nick($1,$2)),$v1,0) 
alias total.deaths !return $iif($readini(sweetmaryjane.ini,DEATHS,$mta.nick($1,$2)),$v1,0) 
;alias current.ratio !return $calc($total.maps($1,$2) / $total.wins($1,%2)) 
alias get.points { 
  var %id = $iif($4,$iif($mta.nick($1,$4) != $null,$4,$get.id($1,$4)),$2) 
  if (%id == -1) mta.pm $1 $2 Error - Invalid Nick. No Player Found Matching That Nick. 
  elseif ($4 == $null) mta.pm $1 $2 Error - No Nick Entered. Please Enter A Nick. 
  elseif (%id == $2) mta.pm $1 $2 You Have A Total Of $iif($readini(smjpoints.ini,POINTS,$mta.nick($1,$2)),$v1,0) Points!. 
  else mta.pm $1 $2 $mta.nick($1,%id) Has A Total Of $iif($readini(smjpoints.ini,POINTS,$mta.nick($1,%id)),$v1,0) Points!.  
} 
alias get.cash { 
  var %id = $iif($4,$iif($mta.nick($1,$4) != $null,$4,$get.id($1,$4)),$2) 
  if (%id == -1) mta.pm $1 $2 Error - Invalid Nick. No Player Found Matching That Nick. 
  elseif ($4 == $null) mta.pm $1 $2 Error - No Nick Entered. Please Enter A Nick. 
  elseif (%id == $2) mta.pm $1 $2 You Have A Total Of $ $+ $iif($readini(smjpoints.ini,CASH,$mta.nick($1,$2)),$v1,0) $+ . 
  else mta.pm $1 $2 $mta.nick($1,%id) Has A Total Of $ $+ $iif($readini(smjpoints.ini,CASH,$mta.nick($1,%id)),$v1,0) $+ .  
} 
alias get.stats { 
  var %id = $iif($4,$iif($mta.nick($1,$4) != $null,$4,$get.id($1,$4)),$2) 
  if (%id == -1) mta.pm $1 $2 Error - Invalid Nick. No Player Found Matching That Nick. 
  elseif ($4 == $null) mta.pm $1 $2 Error - No Nick Entered. Please Enter A Nick. 
  elseif (%id == $2) { 
    mta.pm $1 $2 Your Stats Are: 
    mta.pm $1 $2 Points: $current.points($1,$2) Cash: $current.cash($1,$2) Wins: $total.wins($1,$2) Deaths: $total.deaths($1,$2) Ratio: $current.ratio($1,$2)    
    else { 
      mta.pm $1 $2 $mta.nick($1,%id) $+ 's Stats Are: 
      mta.pm $1 $2 Points: $current.points($1,%id) Cash: $current.cash($1,%id) Wins: $total.wins($1,%id) Deaths: $total.deaths($1,%id) Ratio: $current.ratio($1,%id)  
    } 
  } 
} 
alias get.alive { 
  if (%alive == 1) mta.pm $1 $2 There Is Currently %alive Player Alive. 
  else mta.pm $1 $2 There Are Currently %alive Players Alive. 
} 
alias get.dead { 
  if (%dead == 1) mta.pm $1 $2 There Is Currently %dead Player Dead. 
  else mta.pm $1 $2 There Are Currently %dead Players Dead. 
} 
alias get.deaths { 
  if (%deaths == 1) mta.pm $1 $2 There Has Been %deaths Death So Far This Map. 
  else mta.pm $1 $2 There Have Been %deaths Deaths So Far This Map. 
} 
alias get.ghosts { 
  if (%ghosts == 1) mta.pm $1 $2 There Is Currently %ghosts Ghost Watching Over This Server. 
  else mta.pm $1 $2 There Are Currently %ghosts Ghosts Watching Over This Server. 
} 
alias get.players { 
  if (%stotal == 1) mta.pm $1 $2 You Are The Only Player In The Server! 
  else { 
    mta.pm $1 $2 There Are Currently %stotal Players In The Server! 
    if (%alive == 1) && (%dead == 1) && (%ghosts == 1) mta.pm $1 $2 %alive Player Alive / %dead Player Dead / %ghosts Ghost. 
    elseif (%alive != 1) && (%dead != 1) && ($ghosts != 1) mta.pm $1 $2 %alive Players Alive / %dead Players Dead / %ghosts Ghost. 
    elseif (%alive != 1) && (%dead == 1) && ($ghosts == 1) mta.pm $1 $2 %alive Players Alive / %dead Player Dead / %ghosts Ghost. 
    elseif (%alive == 1) && (%dead != 1) && ($ghosts == 1) mta.pm $1 $2 %alive Player Alive / %dead Players Dead / %ghosts Ghost. 
    elseif (%alive == 1) && (%dead == 1) && ($ghosts != 1) mta.pm $1 $2 %alive Player Alive / %dead Player Dead / %ghosts Ghosts. 
    elseif (%alive != 1) && (%dead != 1) && ($ghosts == 1) mta.pm $1 $2 %alive Players Alive / %dead Players Dead / %ghosts Ghost. 
    elseif (%alive == 1) && (%dead != 1) && ($ghosts != 1) mta.pm $1 $2 %alive Player Alive / %dead Players Dead / %ghosts Ghosts. 
    elseif (%alive != 1) && (%dead == 1) && ($ghosts != 1) mta.pm $1 $2 %alive Players Alive / %dead Player Dead / %ghosts Ghosts. 
  } 
} 
on *:SIGNAL:mta.command: { 
  var %id = $iif($4,$iif($mta.nick($1,$4) != $null,$4,$get.id($1,$4)),$2) 
  if ($3 == Points) get.points $1- 
  elseif ($3 == Cash) || ($3 == Money) get.cash $1- 
  elseif ($3 == Stats) get.stats $1- 
  elseif ($3 == Alive) get.alive $1- 
  elseif ($3 == Dead) get.dead $1- 
  elseif ($3 == Deaths) get.deaths $1- 
  elseif ($3 == Ghosts) get.ghosts $1- 
  elseif ($3 == Players) get.players $1- 
} 
on *:SIGNAL:mta.connect: { 
  set %alive N/A 
  set %ghosts N/A 
  set %dead N/A 
  set %deaths N/A 
  set %mtotal N/A 
  set %stotal $mta.server($1).players 
  set %mode DM 
} 
on *:SIGNAL:mta.join: { 
  !writeini -n sweetmaryjane.ini STATUS $mta.nick($1,$2) GHOST 
  %inc %stotal   
  if (%ghosts != N/A) %inc %ghosts  
} 
on *:SIGNAL:mta.startrace: { 
  set %alive $mta.server($1).players 
  set %ghosts 0 
  set %dead 0 
  set %deaths 0 
  set %mtotal $mta.server($1).players 
  set %mode DM 
  if (%mtotal >= 1) { 
  var %c = 0 
  while (%c <= %mtotal) { 
    !writeini -n sweetmaryjane.ini STATUS $mta.nick($1,%c) ALIVE 
    !writeini -n sweetmaryjane.ini MAPS $mta.nick($1,%c) $calc($total.maps($1,%c) + 1) 
  } 
  !inc %c 
} 
on *:SIGNAL:mta.death: { 
  !writeini -n sweetmaryjane.ini STATUS $mta.nick($1,$2) DEAD 
  !writeini -n sweetmaryjane.ini DEATHS $mta.nick($1,$2) $calc($total.deaths($1,$2) + 1) 
  if (%mtotal != N/A) %dec %mtotal 
  if (%alive != N/A) %dec %alive 
  if (%dead != N/A) %inc %dead 
  if (%deaths != N/A) %inc %deaths  
} 
on *:SIGNAL:mta.respawn: { 
  !writeini -n sweetmaryjane.ini STATUS $mta.nick($1,$2) ALIVE 
  set %mode RSDM 
  if (%alive != N/A) %inc %alive 
  if (%dead != N/A) %dec %dead 
  if (%mtotal != N/A) %inc %mtotal 
} 
on *:SIGNAL:mta.part: { 
  %dec stotal 
  if (ALIVE == $current.status($1,$2)) { 
    !writeini -n sweetmaryjane.ini STATUS $mta.nick($1,$2) PARTED 
    if (%mtotal != N/A) %dec %mtotal 
    if (%alive != N/A) %dec %alive 
    if (%dead != N/A) %inc %dead 
    if (%deaths != N/A) %inc %deaths 
  }  
  elseif (DEAD == $current.status($1,$2)) !writeini -n sweetmaryjane.ini STATUS $mta.nick($1,$2) PARTED   
  elseif (GHOST == $current.status($1,$2)) { 
    !writeini -n sweetmaryjane.ini STATUS $mta.nick($1,$2) PARTED 
    if (%ghosts != N/A) %dec %ghosts 
  } 
} 
on *:SIGNAL:mta.finish: { 
  points.cash $1- 
} 
on *:SIGNAL:mta.endrace: { 
  points.cash $1- 
} 
on *:SIGNAL:mta.disconnect: { 
  remini -n sweetmaryjane.ini STATUS 
} 
  

This shit is like a drug, my eyes are all red and my head is spinning!

I can't stop LOL!

Thanks for all the input guys!

4:20

Link to comment
  • 3 weeks later...
  • Recently Browsing   0 members

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