HouseMD Posted May 8, 2007 Posted May 8, 2007 (edited) With this you can add a command without uploading a script etc. alias check.com { unset %check var %a = 2 while (%a <= $lines(addcom.ini)) { if ($gettok($read(addcom.ini, %a),1,$asc(=)) == $4) { set %check $calc(%check + 1) } !inc %a } } alias check.com2 { unset %check var %a = 2 while (%a <= $lines(addcom.ini)) { if ($gettok($read(addcom.ini, %a),1,$asc(=)) == $3) { set %check $calc(%check + 1) } !inc %a } } on *:SIGNAL:mta.command: { addcom $1- if ($3 == !addcom) { check.com $1- if (!$4) mta.pm $1 $2 Error: !addcom elseif (!$5) mta.pm $1 $2 Error: !addcom elseif (%check >= 1) || (%check == 1) mta.pm $1 $2 Command Already Created! else { if ($left($4,1) == $chr(33)) { if ($gus.level($1,$2) >= 4) { mta.text $1 The command " $+ $4 $+ " has been added! !writeini -n addcom.ini addcom $4 $5- } else mta.pm $1 $2 You need to be level 5 to use this command! } else mta.pm $1 $2 You need a "!" infront of your command! } } elseif ($3 == !remcom) { check.com $1- if (!$4) mta.pm $1 $2 Error: !remcom elseif (%check = 0) || (%check == $null) mta.pm $1 $2 Command Never Created! else { if ($left($4,1) == $chr(33)) { if ($gus.level($1,$2) >= 4) { mta.text $1 Command " $+ $4 $+ " Deleted! !remini -n addcom.ini addcom $4 } else mta.pm $1 $2 You need to be level 5 to use this command! } else mta.pm $1 $2 You need a "!" infront of your command } } elseif ($3 == !listcom) || ($3 == !listcoms) { var %a = 2 while (%a <= $lines(addcom.ini)) { if (!%b) set %b $gettok($read(addcom.ini, %a),1,$asc(=)) elseif ($numtok(%b,32) <= 9) set %b %b $+ , $gettok($read(addcom.ini, %a),1,$asc(=)) elseif (!%c) set %c $gettok($read(addcom.ini, %a),1,$asc(=)) elseif ($numtok(%c,32) <= 9) set %c %c $+ , $gettok($read(addcom.ini, %a),1,$asc(=)) elseif (!%d) set %d $gettok($read(addcom.ini, %a),1,$asc(=)) elseif ($numtok(%d,32) <= 9) set %d %d $+ , $gettok($read(addcom.ini, %a),1,$asc(=)) elseif (!%e) set %e $gettok($read(addcom.ini, %a),1,$asc(=)) elseif ($numtok(%e,32) <= 9) set %e %e $+ , $gettok($read(addcom.ini, %a),1,$asc(=)) elseif (!%f) set %f $gettok($read(addcom.ini, %a),1,$asc(=)) elseif ($numtok(%f,32) <= 9) set %f %f $+ , $gettok($read(addcom.ini, %a),1,$asc(=)) elseif (!%g) set %g $gettok($read(addcom.ini, %a),1,$asc(=)) elseif ($numtok(%g,32) <= 9) set %g %g $+ , $gettok($read(addcom.ini, %a),1,$asc(=)) elseif (!%h) set %h $gettok($read(addcom.ini, %a),1,$asc(=)) elseif ($numtok(%h,32) <= 9) set %h %h $+ , $gettok($read(addcom.ini, %a),1,$asc(=)) !inc %a } if (!%b) mta.text $1 There are no Variables created else { mta.text $1 Created Command(s): %b mta.text $1 %c mta.text $1 %d mta.text $1 %e mta.text $1 %f mta.text $1 %g mta.text $1 %h } unset %b unset %c unset %d unset %e unset %f unset %g unset %h } } alias Addcom { check.com2 $1- if (%check == 1) || (%check >= 1) mta.text $1 $readini(addcom.ini,addcom,$3) } And sry scooby for before, i had no right to use your script! EDIT: if the "!" isn't in the front, you can't use it! (Thx liltoady) Edited May 26, 2007 by Guest Always Remember, Everyone Lies and Trust No-one
Scooby Posted May 9, 2007 Posted May 9, 2007 well u have my msn... u could have just asked and i wouldnt have said no. its ok anyway. [UVA]Scooby Founder Of UVA - Ultimate Vice Assassins http://www.uvaclan.com/
robik Posted May 9, 2007 Posted May 9, 2007 cool script but it may be abused..so I say only admins should have the command !addcom..I tested (being a normal player) and it succeded..
HouseMD Posted May 9, 2007 Author Posted May 9, 2007 Oh yes... I forgot to add the level system, i'll edit and make for GUS! Change the Gus.level to mta.level for normal RCON thing Always Remember, Everyone Lies and Trust No-one
Scooby Posted May 9, 2007 Posted May 9, 2007 u have some elseif's that should be if's elseif ($gus.level($1,$2) >= 4) { these should be if's. and what happened to the line spacings? makes it harder to read how uve posted it. [UVA]Scooby Founder Of UVA - Ultimate Vice Assassins http://www.uvaclan.com/
HouseMD Posted May 26, 2007 Author Posted May 26, 2007 NEW AND EDITED ADDCOM SCRIPT Fixed Bugs: *Command Detection is better Extras: *!Listcom to see all your commands Always Remember, Everyone Lies and Trust No-one
JB_frozen Posted May 26, 2007 Posted May 26, 2007 to see all your commands that are added can just be done by this: on *:text:!show*:#:{ var %x = 1, %z = $lines($scriptdir $+ commands.txt) while %x <= %z { !write -ds " $+ $scriptdir $+ commands.txt" n %x inc %x } }
Scooby Posted May 26, 2007 Posted May 26, 2007 House, if u use 'var' instead of 'set', for most of those commands, then u dont need to set (store) the variables, then unset them, it will work a lot faster. [UVA]Scooby Founder Of UVA - Ultimate Vice Assassins http://www.uvaclan.com/
thestrangestick Posted August 12, 2007 Posted August 12, 2007 so House, If I change gus.level to prs.level, the script will work fine and with the variables %s and %u that are found on the 100% Wankenstein scripts?
proracer Posted February 28, 2009 Posted February 28, 2009 Where to copy this? I mean how to install...Please tell me
Recommended Posts