Jump to content

MTA:MA Scripting


Harry

Recommended Posts

i cannot understand any of that code! Its annyoing to look at and go "What... the...helll....?" cuz i cant understand a single line! All i need is the part that thinks... If they arent where they are supposed to be, FIRED. bada bing, bada boom. I tried using aliases to help me, >.< no luck. i tried a smaller one, like to test to see if it would work and it dont.... it would do like,

.timer 0 10 woot

}

alias woot {

if ($mta.area($1,$2) != $readini(----)) {

mta.slap $1 $2

}

}

nothing.

Link to comment
  • Replies 357
  • Created
  • Last Reply

Top Posters In This Topic

  • 2 weeks later...

Hey,

Take a look in Aerons HTML File inside your miRC folder. That sould list the MTA:mA alias's for you. One way that i find helpful, is just looking though areon's mta.mrc. Looking at all the alias's n stuff.

Cya,

[XE]Tommis

Link to comment
  • 3 months later...

I have a problem with my script. On !mop there is no mop1 but mop 1 till 5.

  if ($3 == !mop) {
   if ($readini($scriptdir $+ mop.ini,MOPS,1) == 1) {
     mta.text $1 mop 1
     !writeini -n " $+ $scriptdir $+ mop.ini" MOPS 1 2
   }
   else 
     if ($readini($scriptdir $+ mop.ini,MOPS,2) == 1) {
       mta.text $1 mop 2
       !writeini -n " $+ $scriptdir $+ mop.ini" MOPS 2 2       
     }
     else
       if ($readini($scriptdir $+ mop.ini,MOPS,3) == 1) {
         mta.text $1 mop 3
         !writeini -n " $+ $scriptdir $+ mop.ini" MOPS 3 2
       }
       else
         if ($readini($scriptdir $+ mop.ini,MOPS,4) == 1) {
           mta.text $1 mop 4
           !writeini -n " $+ $scriptdir $+ mop.ini" MOPS 4 2
         }
         else
           if ($readini($scriptdir $+ mop.ini,MOPS,5) == 1) {
             mta.text $1 mop 5
             !writeini -n " $+ $scriptdir $+ mop.ini" MOPS 4 1
             !writeini -n " $+ $scriptdir $+ mop.ini" MOPS 3 1
             !writeini -n " $+ $scriptdir $+ mop.ini" MOPS 2 1
             !writeini -n " $+ $scriptdir $+ mop.ini" MOPS 1 1
           }
 }

What's wrong?

Link to comment

What you want to do with this script?

Here are 2 different codes trying to guess what you need:

if ($3 == !mop) {
 var %a = 1
 !writeini -n " $+ $scriptdir $+ mop.ini" MOPS 1 1
 while (%a <= 5) {
   if ($readini($scriptdir $+ mop.ini,MOPS,%a) == 1) {
     mta.text $1 mop %a
     !writeini -n " $+ $scriptdir $+ mop.ini" MOPS $calc(%a+1) 1
   }
   !inc %a
 }
}

if ($3 == !mop) {
 var %a = 5,%b = 1
 while ((%a >= 1) && (%b == 1)) {
   if ($readini($scriptdir $+ mop.ini,MOPS,%a) == 1) { mta.text $1 mop %a | %b = %a + %b }
   !dec %a
 }
 if (%b <= 5) !writeini -n " $+ $scriptdir $+ mop.ini" MOPS %b 1
}

Link to comment
then use this

if ($3 == !mop) {
 var %a = 5,%b = 1
 while ((%a >= 1) && (%b == 1)) {
   if ($readini($scriptdir $+ mop.ini,MOPS,%a) == 1) { mta.text $1 mop %a | %b = %a + %b }
   !dec %a
 }
 if (%b <= 5) !writeini -n " $+ $scriptdir $+ mop.ini" MOPS %b 1
}

Where i need to put the mops in that code? :roll:

PS, anyway thanx.

Link to comment

Find a piece of code with another !command line and insert it there. Or find someone for you to do it. Please keep in mind, if you dont understand what and why you are doing things, the chance of completely f*****g up is huge!

Link to comment
  • 2 weeks later...
    var %a = $mta.vehicle($1,$2)
   if ($readini($scriptdir $+ vehicle.ini,VEHICLES,%a) == 1) {

[VEHICLES]

451=1

And when in bullet (id 451 isn't it?) nothing happens. Under the if command there is a mta.text command. :x

It might read entry number 451, try forcing it as a text with the 't'-switch, (/help $readini)

Link to comment
    var %a = $mta.vehicle($1,$2)
   if ($readini($scriptdir $+ vehicle.ini,VEHICLES,%a) == 1) {

[VEHICLES]

451=1

And when in bullet (id 451 isn't it?) nothing happens. Under the if command there is a mta.text command. :x

It might read entry number 451, try forcing it as a text with the 't'-switch, (/help $readini)

Sorry what is the t-switch? :oops:

Link to comment
    var %a = $mta.vehicle($1,$2)
   if ($readini($scriptdir $+ vehicle.ini,VEHICLES,%a) == 1) {

[VEHICLES]

451=1

And when in bullet (id 451 isn't it?) nothing happens. Under the if command there is a mta.text command. :x

It might read entry number 451, try forcing it as a text with the 't'-switch, (/help $readini)

Sorry what is the t-switch? :oops:

Do you mean:

    if ($readini($scriptdir $+ vehicle.ini,VEHICLES,%a) == 1) {
     mta text $1 $mta.vehicle($1,$2)
   }

Link to comment
  • 2 weeks later...

hi all

Whenever i want to get a script running on my server, it never works there. but it does work in mirc and it also loads in mta:ma.

just not on the server. so i guess i dont load them properly in mta:ma or so.

what do i need to do to make it work.

i have mta:ma 4.15 and mirc 6.17.

thanks in advance.

Link to comment
you forgot to specify what the server is :roll: MTA 0.5 or MTA:SA? If mta0.5 you need mta:ma v3.x, 4.x won't work

oh, im sorry for that.

it is MTA:SA

you need ]MTA:mA v4.0 (MTA:SA compatible) .. first sticky topic in add-ons

one more.

can i put more of those *:SIGNAL:mta.command:{

in one script file? like an all-in-one.

so i dont have one file for every little thing.

yes .. but not two of the same events

but you can do .. example

on *:SIGNAL:mta.command:{
  if ($3 == !command1} {
   mta.text $1 command 1 
   }
  elseif ($3 == !blabla2} {
   mta.text $1 blabla2 
   }
}

Edited by Guest
Link to comment
  • 2 months later...
  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...