Jump to content

MTA:MA Scripting


Harry

Recommended Posts

Just write one. MTA:mA:GRS has a series of checks to ensure that the admin levels are kept at 5, however its not hard to write your own system, if you are doing. If not, just use GRS.. thats why its there.

Link to comment
  • Replies 357
  • Created
  • Last Reply

Top Posters In This Topic

havn't visited here for a while, noticed everyone is using these token things, will have to have a look at that, can't believe how many people want you to write a simple script for them because they are too lazy learning how to (suppose this is a bit of a flame) come on people, read the mirc help file and the mta:ma help file

Link to comment

on *:SIGNAL:mta.join:{
if ($readini(login.ini,$mta.name($1,$2),level)) {
 mta.msg $1 $2 login
}
else {
 mta.msg $1 $2 register
}
}


on *:SIGNAL:mta.pm:{
if ($3 == login) {
 set %pass $readini(login.ini,$mta.name($1,$2),password)
 if (%pass = $4) { 
  mta.say $1 login successful
 }
 else {
  mta.msg $1 $2 wrong pass
 }
}
if ($3 == register) {
 writeini -n login.ini $+(",$mta.name($1,$2),") password $4
 writeini -n login.ini $+(",$mta.name($1,$2),") level 1
}
}

on *:SIGNAL:mta.command:{
if ($3 == !level) {
 if ($4 isnum) {
  mta.say $1 $mta.name($1,$4) is level $readini(login.ini,$mta.name($1,$4),level)
 }
 else {
  mta.say $1 $mta.name($1,$2) is level $readini(login.ini,$mta.name($1,$2),level)   
 }
}
if (($3 == !setlevel) && ($readini(login.ini,$mta.name($1,$2),level) > 7)) {
 if ($5 > 10) {
  mta.say $1 can't be more than 10
 }
 else {
  mta.say $1 $mta.name($1,$4) is set to level $5
  writeini -n login.ini $+(",$mta.name($1,$4),") level $5
 }
}
}

something along those lines, im sure you can add what you need and all the error checking bits...

Link to comment

Like this??

on *:SIGNAL:mta.join:{

if ($readini(login.ini,$mta.name($1,$2),level)) {

mta.msg $1 $2 login

}

else {

mta.msg $1 $2 register

}

}

on *:SIGNAL:mta.pm:{

if ($3 == login) {

set %pass $readini(login.ini,$mta.name($1,$2),password)

if (%pass = $4) {

mta.say $1 $mta.name Logged In succesfully (

}

else {

mta.msg $1 $2 wrong pass ($1,$2),level)

}

}

if ($3 == register) {

writeini -n login.ini $+(",$mta.name($1,$2),") password $4

writeini -n login.ini $+(",$mta.name($1,$2),") level 1

}

}

on *:SIGNAL:mta.command:{

if ($3 == !level) {

if ($4 isnum) {

mta.say $1 $mta.name($1,$4) is level $readini(login.ini,$mta.name($1,$4),level)

}

else {

mta.say $1 $mta.name($1,$2) is level $readini(login.ini,$mta.name($1,$2),level)

}

}

if (($3 == !setlevel) && ($readini(login.ini,$mta.name($1,$2),level) > 7)) {

if ($5 > 10) {

mta.say $1 can't be more than 10

}

else {

mta.say $1 $mta.name($1,$4) is set to level $5

writeini -n login.ini $+(",$mta.name($1,$4),") level $5

}

}

Link to comment

if i typ: !car

hes said: Myname is riding in a .

hes saying not the name of the verhicle

and if i spawn he said:

Myname is spawned as Unknown

he dont say the skin

What most i do?

Thnx

JS

Link to comment

Put this under: on *:SIGNAL:mta.command:{

  var %a = $iif($4 != $null,$iif($ini($mta.dir $+ $1.ini,ID $+ $4),$4,$mta.getid($1,$4)),$2) 
if ($3 == !car) { 
  if (%a == -1) mta.msg $1 $2 Error - Invalid ID
elseif ($mta.vehicle($1,%a).name == unknown) mta.msg $1 $2 Error - can't get car status. 
else {
mta.say $1 $mta.name($1,%a) is on a $mta.vehicle($1,%a).name with $mta.health($1,%a).vehicle) $+ % damage    
   } 
 } 

enjoy :thumbright:

Link to comment
  • 3 weeks later...

Hi there, i have problem when i'm conected to server i am connected 10 sec and than my Conection is Timed Out

* Connecting to 10.0.3.118:4003... (Normal)

* MOTD URL:

* Connected!

* Game: GTA:VC | Mode: Deathmatch | Submode: | 0 / 10

* Disconnected: Timed out.

Please for help :)

Link to comment
  • 1 month later...

elo, ive got problem:

I have code:

dialog menu {
 menu "", 1
 item "", 2, 1 
 item "", 3, 1, cancel
 menu "", 5
 item "", 6, 5
 item "", 7, 5
 menu "", 8
 item "", 10, 8
 item "", 11, 8
 menu "", 66
 item "", 67, 66
 item "", 68, 66
}

on *:DIALOG:menu:init:*:{
 !did -o menu 1 $readini($scriptdir $+ test.ini,lol,1)
 !did -o menu 2 $readini($scriptdir $+ test.ini,lol,2)
 !did -o menu 3 $readini($scriptdir $+ test.ini,lol,3)
 !did -o menu 5 $readini($scriptdir $+ test.ini,lol,4)
 !did -o menu 6 $readini($scriptdir $+ test.ini,lol,5)
 !did -o menu 7 $readini($scriptdir $+ test.ini,lol,6)
 !did -o menu 8 $readini($scriptdir $+ test.ini,lol,7)
 !did -o menu 10 $readini($scriptdir $+ test.ini,lol,
 !did -o menu 11 $readini($scriptdir $+ test.ini,lol,9)
 !did -o menu 66 $readini($scriptdir $+ test.ini,lol,10)
}

and I want add test in menu and item via init, it work with item but with menu no, why ? -a, -ra, -i dont work... this also doesnt work:

menu & $+ $readini($scriptdir $+ test.ini,lol,1) , 1
item & $+ $readini($scriptdir $+ test.ini,lol,2) , 2

I dunno completly why.. can u help me ?

Link to comment

Search for 'dialog studio' and type /help /dialog into mirc..

Example: (:P)

dialog menu {
 title "My 1337 dialog"
 size -1 -1 125 59
 option dbu
 edit "", 1, 0 2 123 46, read multi autovs vsbar
 button "Format C:\", 2, 35 49 37 10
}
on *:LOAD: menu.load
alias menu.load {
 if ($dialog(menu)) !dialog -v menu menu
 else !dialog -md menu menu
}
on *:DIALOG:menu:init:*:{
 !did -a menu 1 Oh look i've added some text!
 !did -a menu 1 $crlf $+  some more text!
}
on *:DIALOG:menu:sclick:2: !dialog -x menu

Link to comment
  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...