Hi all, I started work on an admin-only levelup command, to levelup whatever player the admin chooses, with a slash command.
I made some changes to the client's Ruby script as well as some changes to a few of the server files.
Client Ruby Files:
I added the following command module command(s) (levelup) to the (RMX-OS) Script:
COMMANDS[GROUP_ADMIN] = ['admin', 'levelup']
In the "Descriptions" part of the module, under "# Admin Commands", I added the following command(s) to the (RMX-OS) Script:
DESCRIPTIONS['levelup'] = 'Levels up a player by X levels'
I added the following command(s) to the parameters module to the (RMX-OS) Script:
PARAMETERS['levelup'] = 'USERNAME LEVEL'
In the definition "check_admin_commands(message)", I added the "when" command(s):
when /\A\/levelup (\S+) (\S+)\Z/ # levelup a player
command_user_levelup($1, $2)
return true
I added the following def command(s) to the (RMX-OS) Script:
#--------------------------------------------------------------------------
# Executes chat command for usergroup change.
# username - username of the player
# level - new user level
#--------------------------------------------------------------------------
def command_user_levelup(username, level)
self.send("LVL#[username]\lu#[level]")
end
Server Ruby Files:
I modified the following files:
Client.rb
Action_Handler3.rb
Inside Action_Handler3.rb, I added the "def":
"try_user_levelup(username, level)"
(The SQL command for try_user_levelup(username, level), is:
check = RMXOS.server.sql.query("SELECT username, level FROM users WHERE username = '#{RMXOS.fix_string(username)}' AND level = '#{RMXOS.fix_string(level)}'")
Inside Client.rb, I added the "when" command:
"when /\LVL(.+)\t(.+)/ # change player level"
I also updated the SQL file:
I added:
" `level` int(10) NOT NULL default 1, ",
to the CREATE TABLE `users` declaration
Here is the WHOLE project with modified files :
http://www.mediafire.com/?vllcbzpi3t49b1iThanks for the help!