Aggressor Posted February 24, 2007 Share Posted February 24, 2007 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
damnet007 Posted February 24, 2007 Share Posted February 24, 2007 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 Link to comment
Aggressor Posted February 25, 2007 Author Share Posted February 25, 2007 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 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
damnet007 Posted February 25, 2007 Share Posted February 25, 2007 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
Aggressor Posted February 25, 2007 Author Share Posted February 25, 2007 Ok, gonna try that one. Thanks for ur help Link to comment
Aggressor Posted February 25, 2007 Author Share Posted February 25, 2007 ok it works for most commands, but exept this one: 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 == !settime) mta.settime $1 $4 Link to comment
damnet007 Posted February 25, 2007 Share Posted February 25, 2007 remove the 'if (%a != -1)' line and the bracket which goes with it. if u want, add me on msn i'll help you out Link to comment
Aggressor Posted February 25, 2007 Author Share Posted February 25, 2007 remove the 'if (%a != -1)' line and the bracket which goes with it. if u want, add me on msn i'll help you out Aha ok, my msn is [email protected] Ah and removed that line but it still doesnt work. Link to comment
Aggressor Posted February 25, 2007 Author Share Posted February 25, 2007 sorted over msn Hehe yes, again thanks for ur help! Ur a fast scripter Link to comment
Recommended Posts