Scooby

MTA:SA Public Release Script - PRS:1.3 Out Now!

Recommended Posts

hi, the most comon reason is because ur splitting the curly brackets in the wrong place, or that ur not adding the right amount in ur new command, this will cause the script to give errors, these can along with any other errors, be seen on the main mirc window.

if for example u wont to add a command, the easiest way is to add ur 1 line command into mta.command, then create a new alias for that command at the very end of the script, that way u shouldnt have to touch the brackets at all.

example:

elseif ($3 == !showmesomestuff) showmesomestuff $1-

this line would be added after the first 'if' line in mta.command, which should be: if ($3 == !name) mta.text $1 Map Name: $mta.race($1)

once ur line is added, move down to the very end of the script (thats if ur not sure how to add to the middle of it)

then u can add ur new alias, like so:

alias showmesomestuff {

put what u want the command to do in here

and dont forget the final bracket below

}

the alias can be as big or small as u like, and u as long as ur names are not duplicates then they'll work fine.

any other questions, just let me know... i hope this helps,

if not u need to go back to the very basics,

i posted a basic tutorial on these forums a while back,

it should be there somewhere... try a search.

Share this post


Link to post
hi, the most comon reason is because ur splitting the curly brackets in the wrong place, or that ur not adding the right amount in ur new command, this will cause the script to give errors, these can along with any other errors, be seen on the main mirc window.

if for example u wont to add a command, the easiest way is to add ur 1 line command into mta.command, then create a new alias for that command at the very end of the script, that way u shouldnt have to touch the brackets at all.

example:

elseif ($3 == !showmesomestuff) showmesomestuff $1-

this line would be added after the first 'if' line in mta.command, which should be: if ($3 == !name) mta.text $1 Map Name: $mta.race($1)

once ur line is added, move down to the very end of the script (thats if ur not sure how to add to the middle of it)

then u can add ur new alias, like so:

alias showmesomestuff {

put what u want the command to do in here

and dont forget the final bracket below

}

the alias can be as big or small as u like, and u as long as ur names are not duplicates then they'll work fine.

any other questions, just let me know... i hope this helps,

if not u need to go back to the very basics,

i posted a basic tutorial on these forums a while back,

it should be there somewhere... try a search.

* /if : invalid format (line 1007, MTA-PRS1.3.mrc 

What that means?It sometimes gives me that error in mIRC chat window or whatever.And when i type not !if etc... i type !elseif etc...that its correct but that it says * /dialog : invalid format dont know what line..xD

Btw.Ye...maybe i don't understand too well.But can i fix error without adding some alias?

Share this post


Link to post

well it usually means the error is in that line, paste me line 1007, or the whole alias.

im guessing your script is different to mine,

it looks like it could be in the join alias going by the line numbers in my prs script but if u paste it i'll be able to tell better.

Share this post


Link to post
well it usually means the error is in that line, paste me line 1007, or the whole alias.

im guessing your script is different to mine,

it looks like it could be in the join alias going by the line numbers in my prs script but if u paste it i'll be able to tell better.

if (($prs.clantag($1) isin %a) mta.pm $1 $2 IP Mismatch, Login To Save New IP 
  

Here it is.Please help me =] But i think maybe it's mIRC problem cuz sometimes i couldn't get it right.It said $did line error etc...but i can now.And i ain't sure if script is different.I have original copy of your's for sure.Becuase i keep it somewhere and modified version in mIRC.When some problem comes or whatever i just copy my original one. :)

Share this post


Link to post

Ah i see, i remember that version :mrgreen:

theres a bug in that line, just delete the first bracket... seems theres one too many.

my version of prs has a few little fixes in like this and small modifications that ive come across along the way,

so thats why my line numbers dont match urs.

the line should read:

if ($prs.clantag($1) isin %a) mta.pm $1 $2 IP Mismatch, Login To Save New IP 

try that, sorry about that.

Share this post


Link to post

OK look.I made some little commands if you wanna see if im correct.I'll copy the beggining..thats mta.command than on very end of script i put alias.Ok Check this out.

on *:SIGNAL:mta.command: { 
  var %a = $iif((!$4),$2,$iif(($prs.getid($1,$4) == $null),$2,$v1)),%race = $replace($mta.race($1),$chr(32),$chr(45)) 
  if ($3 == !name) mta.text $1 Map Name: $mta.race($1) 
  elseif ($3 == !stuck) stuck $1- 
  elseif ($3 == !hi) hi $1- 
  elseif ($3 == !addpoints) addpoints $1- 
  elseif ($3 == !addcash) addcash $1- 

} 
alias stuck { 
elseif ($4 == $null ) mta.pm $1 $2 Error: Please specify a name, !stuck <name> 
else 
mta.text $1 You're stuck $mta.nick($1,%a),please do /kill. 
} 
alias hi { 
elseif ($4 == $null ) mta.pm $1 $2 Error: Please specify a name, !hi <name> 
else 
mta.text $1 Hi,$mta.nick($1,%a)! 
} 
alias addpoints { 
if ($prs.level($1,$2) >=4) { 
if ($4 == $null ) mta.pm $1 $2 Error: Please specify a name and ammount, !addpoints <name> <ammount>  
else { 
mta.text $1 $mta.nick($1,$2) gave $mta.nick($1,%a) >=0 { 
!hadd prsrank $mta.nick($1,$2) $calc($prs.points($1,$2) + >=0 
}  
} 
} 
alias addcash { 
if ($3 == !addcash) { 
if ($prs.level($1,$2) >=4) { 
if ($4 == $null ) mta.pm $1 $2 Error: Please specify a name and ammount, !addcash <name> <ammount> 
else { 
mta.text $1 $mta.nick($1,$2) gave $mta.nick($1,%a) >=0 { 
pgs.add $mta.nick($1,$2) + >=0 
} 
} 
} 

I started after !name command and finished on end of script.I started with command "!stuck" and made aliases for every command.Please tell if i done correct?

Share this post


Link to post

ok so, theres a couple of simple errors.

alias stuck { 
elseif ($4 == $null ) mta.pm $1 $2 Error: Please specify a name, !stuck <name> 
else 
mta.text $1 You're stuck $mta.nick($1,%a),please do /kill. 
} 
alias hi { 
elseif ($4 == $null ) mta.pm $1 $2 Error: Please specify a name, !hi <name> 
else 
mta.text $1 Hi,$mta.nick($1,%a)! 
} 

lets take them one at a time..

first, u cannot start the first line of the alias with 'elseif', the format is, if - elseif - else.

so this line: elseif ($4 == $null ) mta.pm $1 $2 Error: Please specify a name, !stuck

should be: if ($4 == $null ) mta.pm $1 $2 Error: Please specify a name, !stuck

and secondly the 'else' line on its own, can be joined to the line below it which also has an error or two, also the second line wont work

since it has no idea what the variable %a is anymore, also after $mta.nick($1,%a) there must always be a space.

if u dont want the space to show in ur text in the chat then u need to add $+ this will remove it.

ok so the line should read:

else mta.text $1 You're stuck $mta.nick($1,%a) $+ ,please do /kill.

a simple 1line/2line command like this would be better in mta.command, since it can be made in 2 lines.

since the variable %a is defined in mta.command and we didnt send it to ur new alias, %a needs to be defined again or we need to edit the first line and send it, so lets do that.

so the finished command needs to look like this, in mta.command: the line should now be:

elseif ($3 == !stuck) stuck $1 $2 %a 

then ur new alias:

alias stuck { 
  if ($2 == $3) mta.pm $1 $2 Error: Please specify a name, !stuck <name> 
  else mta.text $1 You're stuck $mta.nick($1,$3) $+ ,please do /kill. 
}  

the same format needs to be applied to the other alias u made and that should do it.

if you did want to try it again the other way, the whole thing could stay in mta.command and read:

elseif ($3 == !stuck) { 
  if ($2 == %a) mta.pm $1 $2 Error: Please specify a name, !stuck <name> 
  else mta.text $1 You're stuck $mta.nick($1,%a) $+ ,please do /kill. 
} 

remember your brackets and spacings. 1 small error could cause the whole script to stop working.

1 final thing, if u want to add lots of custom commands like this and ur not too sure about things,

then you can make and load and new script of ur own...

it will still work the same and wont effect prs if u break it.

if u need help with this just add me on msn and ask.

msn: the0ne_13@hotmail.com

Share this post


Link to post

else {

if ($prs.clantag($1) isin %a) mta.pm $1 $2 IP Mismatch, Login To Save New IP

else {

mta.pm $1 $2 IP Mismatch

.timer 1 2 mta.pm $1 $2 Auto-Login Failed.

!halt

}

}

}

if ($readini(prsdata.ini,prs,login) == yes) && ($prs.level($1,$2) == 0) {

mta.pm $1 $2 Please Login! $+([,$prs.logintime($1) Secs,])

.timerkick $+ $2 1 $prs.logintime($1) mta.kick $1 $2

Why isn't it working?

Share this post


Link to post

maybe be a little more specific... whats not working?

a few lines from the alias dont tell me much :roll:

Share this post


Link to post

OK.I added you on MSN.OK Thx about that i'll check it later.But you still didn't answered why some admin commands won't work :redhotevil:

Problem: "Quote:GeForce" Wtf is wrong with mIRC xD? Read my previuos posts.

Share this post


Link to post
OK.I added you on MSN.OK Thx about that i'll check it later.But you still didn't answered why some admin commands won't work :redhotevil:

Problem: "Quote:GeForce" Wtf is wrong with mIRC xD? Read my previuos posts.

well they worked before... i guess u broke them by adding something wrongly :)

lol, i'll sort it out with u on msn.

Share this post


Link to post

Postby Scooby on Tue Jun 09, 2009 1:00 pm

maybe be a little more specific... whats not working?

a few lines from the alias dont tell me much :roll:

Don't kick for bad ip :?

Share this post


Link to post
Postby Scooby on Tue Jun 09, 2009 1:00 pm

maybe be a little more specific... whats not working?

a few lines from the alias dont tell me much :roll:

Don't kick for bad ip :?

does mirc show any errorrs?

Share this post


Link to post

How to make a script like this, if player won 2 times in a row, it shows " 2 wins in a row" xD ?

Share this post


Link to post
How to make a script like this, if player won 2 times in a row, it shows " 2 wins in a row" xD ?

ahh i see, leave it with me and i'll see what i can make u later :)

Share this post


Link to post
Ok, ty ;p

ok how do u want it?

do u want to be able to paste it into prs? or run as a separate script alongside prs?

ok ive kept it basic for now, since i dont have any access to test it.. heres the first one then...

just paste these two aliases into a new .mrc file and load it.

on *:SIGNAL:mta.connect: { 
  set %wcount 1 
} 
  
on *:SIGNAL:prs.endrace: { 
  var %winner = $mta.nick($1,$2) 
  if (%winner == %lastwinner) && ($prs.players($1) > 1) { 
    !inc %wcount 
    mta.text $1 Win streak Of %wcount For %winner $+ ! 
  } 
  else set %wcount 1 
  set %lastwinner %winner 
} 

unless u wish to add it to prs, then u will need to put this in prs, in mta.connect:

  set %wcount 1 

then add this to the alias prs.endrace:

  var %winner = $mta.nick($1,$2) 
  if (%winner == %lastwinner) && ($prs.players($1) > 1) { 
    !inc %wcount 
    mta.text $1 Win streak Of %wcount For %winner $+ ! 
  } 
  else set %wcount 1 
  set %lastwinner %winner 

if ur not sure how to do this, go with the first option and use a new .mrc file

any probs, let me know.

Share this post


Link to post

And Scooby, can you do to me a some script, the same map is playing two times and script will show after 3 time when map playing will be random? xD

Share this post


Link to post
And Scooby, can you do to me a some script, the same map is playing two times and script will show after 3 time when map playing will be random? xD

ok try this:

on *:SIGNAL:mta.startrace: { 
  if ($hget(prstemp,currentrace) == $mta.race($1)) { 
    !hadd prstemp racecount $calc($hget(prstemp,racecount) + 1) 
    if ($hget(prstemp,racecount) >= 4) { 
      mta.text $1 Race Counter Limit Reached, Starting A Random Map..... 
      .timer 1 5 mta.startrace $1 $rand(0,$mta.races($1)) 
      !hadd prstemp racecount 1 
    } 
   else mta.text $1 Racecount: $chr(40) $+ $hget(prstemp,racecount) $+ $chr(47) $+ 3 $+ $chr(41) 
  } 
  !hadd prstemp currentrace $mta.race($1) 
} 

thats the whole alias, however, if u just want to add it to prs, add the script below to the very top of the startrace alias (which should be around line 500 in prs)

  if ($hget(prstemp,currentrace) == $mta.race($1)) { 
    !hadd prstemp racecount $calc($hget(prstemp,racecount) + 1) 
    if ($hget(prstemp,racecount) >= 4) { 
      mta.text $1 Race Counter Limit Reached, Starting A Random Map..... 
      .timer 1 5 mta.startrace $1 $rand(0,$mta.races($1)) 
      !hadd prstemp racecount 1 
    } 
   else mta.text $1 Racecount: $chr(40) $+ $hget(prstemp,racecount) $+ $chr(47) $+ 3 $+ $chr(41) 
  } 
  !hadd prstemp currentrace $mta.race($1) 

let me know if it works, i havent been able to test it.

Share this post


Link to post
how to make a command to use it once per 30 sec ??

give me an example of what u need and i'll see what i can do :roll:

Share this post


Link to post

  • Recently Browsing   0 members

    No registered users viewing this page.