Jump to content

admin script help needed


Aggressor

Recommended Posts

Hey there,

I am currently running mtama with my personal scripts loaded.

Now i have added my own script like !slap.

It looks like this:

if ($3 == !slap) && ($mta.name($1,$2) == Test) {

/mta.slap $1 $4

The only user that can use !slap now is ''Test'', now my question, how can i add more users that can use it? i allready tried to just add a name but that way it doesnt work anymore.

Thanks for any help.

Link to comment

most admin scripts i've seen use a level system, and check if the user's level is high enough to use the command:

alias level !return $iif($readini(bla.ini,$mta.name($1,$2),level),$v1,0)

on *:SIGNAL:mta.command:{

if $level($1,$2) > 1 {

if ($3 == !slap) mta.slap ...

}

}

otherwise, you could add the names to a txt/ini file and check if they're name is within the file- for an ini, something like this:

on *:SIGNAL:mta.command:{

...

if $readini(bla.ini,admin,$mta.name($1,$2)) == 1 {

...

}

}

and bla.ini looks like this:

[admin]

name1=1

name2=1

name3=1

etc...

you could do it using a txt file too but i think the ini would be better as you'd have to use a loop to check line(s) of the txt file for an admin name. this is just what i'd do anyway :P

Link to comment
most admin scripts i've seen use a level system, and check if the user's level is high enough to use the command:

alias level !return $iif($readini(bla.ini,$mta.name($1,$2),level),$v1,0)

on *:SIGNAL:mta.command:{

if $level($1,$2) > 1 {

if ($3 == !slap) mta.slap ...

}

}

otherwise, you could add the names to a txt/ini file and check if they're name is within the file- for an ini, something like this:

on *:SIGNAL:mta.command:{

...

if $readini(bla.ini,admin,$mta.name($1,$2)) == 1 {

...

}

}

and bla.ini looks like this:

[admin]

name1=1

name2=1

name3=1

etc...

you could do it using a txt file too but i think the ini would be better as you'd have to use a loop to check line(s) of the txt file for an admin name. this is just what i'd do anyway :P

How must it put it in script?

it looks like this now:

if ($3 == !slap) (if $readini(bla.ini,admin,$mta.name($1,$2) == 1 {

/mta.slap $1 $4

I get very weird things that way

Thanks.

Link to comment

something like this:

on *:SIGNAL:mta.command:{
if $readini(bla.ini,admin,$mta.name($1,$2)) == 1 {
var %a = $iif($4 == $null,$2,$iif($mta.name($1,$4) != Unknown,$4,$mta.getid($1,$4)))
if (%a != -1) {
if ($3 == !slap) mta.slap $1 %a
elseif ($3 == !kick) mta.kick $1 %a
etc...
}
else mta.msg $1 $2 Error - Absent Nick/ID
}
}

bla.ini:

[admin]

name=1

name2=1

etc.

Link to comment
  • Recently Browsing   0 members

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