Jump to content

[REQ] : ! or /addcommand


Recommended Posts

Posted

Hey everyone out there, here´s my next request :D :

i want to have the well-knowned "!addcommand !commandname REAKTION" command in mta : dm :P

i think everybody of you know it from mta : race ^^ ;)

could somebody try to make this for mta : dm ?

MFG + THX Gr00vE

Posted

i think he means like, an admin can type: !addcommand !lol laughs out loud

then when people type !lol, it says laughs out loud

!addcommand !web

!addcommand !rules

etc...

this way, admins can easily add various commands to display custom text.

Posted

well just create a database of the commands and a function to loop through em in the command handler and return the appropriate result..

Posted

dude.. how is that gonna remember the commands if the script is unloaded and loaded or the server is restarted? peachy :D

Posted (edited)

CODE MOVED TO:

http://mtabeta.com/index.php?p=resource ... ails&id=67

commands are:

/addcommand !<commandname> <text> 
/delcommand !<commandname> 
  
!<commandname> [optional text] 

examples:

/addcommand !fire I'm hot

!fire -> "I'm hot"

/addcommand !slap was slapped around a bit with a large trout

!slap meany admin -> "meany admin was slapped around a bit with a large trout

the custom commands are stored in a serverfile, each player (nickname) has its own commands, also note that you can provide an optional text when using a command that is written in front of the message (see 2nd example)

have fun! ;)

Edited by Guest
Posted
thx norby, your script works ! ^^ :) but the command /delcommand doesn´t work and i think it would be better when only admins can use this command... ^^

if you want to restrict the command all you need to do is add a 'true' to the end of the hander like this:

addCommandHandler ( "delcommand", delCommand, true ) 

I'll fix 'delcommand' in a min

EDIT: code is updated, check previous post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

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