Hello everybody,I've a problem with Net rmxp 2.0
I can't get the admin control pannel,I don't know how to do to get it =/
If someone can tell me how ^^
Here's the [ADN] Admin_Control_Pannel script :
I can't get the admin control pannel,I don't know how to do to get it =/
If someone can tell me how ^^
Here's the [ADN] Admin_Control_Pannel script :
Code:
#==============================================================================
# ** Scene_Admin
#==============================================================================
#HOW TO INSTALL:
# 1- GO IN [SC2]
# 2- ADD IN DEF UPDATE_rCHAT THIS:
#
# if Input.trigger?(Input::F9)
# if Network::Main.group == 'admin'
# $scene = Scene_Admin.new
# end
# end
# TO MAKE THE A.PANNEL AVAIBLE WITH F9
class Scene_Admin
#--------------------------------------------------------------------------
# * Object Initialization
# menu_index : command cursor's initial position
#--------------------------------------------------------------------------
def initialize(menu_index = 0)
@menu_index = menu_index
@userlist_index = menu_index
end
#--------------------------------------------------------------------------
# * Main Processing
#--------------------------------------------------------------------------
def main
@sprite = Sprite.new
@sprite.bitmap = RPG::Cache.title($data_system.title_name)
# Make command window
s1 = 'Kick'
s2 = 'Kick All'
s3 = 'Raise'
s4 = 'Raise All'
s5 = 'Sposta Mappa'
s6 = 'Sposta X'
s7 = 'Sposta Y'
s8 = 'Switch On'
s9 = 'Switch Off'
s10 = 'Gain Item'
s11 = 'Gain Wpn'
s12 = 'Gain Armor'
s13 = 'Gain Gold'
@command_window = Window_Command.new(160, [s1,s2,s3,s4,s5,s6,s7,s8,s9,s10,s11,s12,s13])
@command_window.index = @menu_index
# Make play time window
@userlist_window = Userslist_Admin.new
@userlist_window.x = 160
@userlist_window.y = 0
@userlist_window.index = @menu_index
@number_x_window = Admin_Window_Input_Number.new(3)
@number_x_window.x = 500
@number_x_window.y = 16
Graphics.transition
# Main loop
loop do
# Update game screen
Graphics.update
# Update input information
Input.update
# Frame update
update
# Abort loop if screen is changed
if $scene != self
break
end
end
# Prepare for transition
Graphics.freeze
# Dispose of windows
@command_window.dispose
@userlist_window.dispose
@number_x_window.dispose
@sprite.dispose
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
# Update windows
@command_window.update
@userlist_window.update
# If command window is active: call update_command
if @command_window.active
update_command
return
end
# If status window is active: call update_status
if @userlist_window.active
update_status
return
end
if @number_x_window.active
@number_x_window.update
update_enter
end
end
#--------------------------------------------------------------------------
# * Frame Update (when command window is active)
#--------------------------------------------------------------------------
def update_command
# If B button was pressed
if Input.trigger?(Input::B)
# Play cancel SE
$game_system.se_play($data_system.cancel_se)
# Switch to map screen
$scene = Scene_Map.new
return
end
# If C button was pressed
if Input.trigger?(Input::C)
# Branch by command window cursor position
case @command_window.index
when 0
@who= @userlist_window.data2[@userlist_window.index]
Network::Main.socket.send("TOID|#{@who}|<10>self.kick_player('#{@who}')</10>|<->")
$scene=Scene_Map.new
when 1
Network::Main.socket.send("ALL|<10b>kick_all</10>|<->")
$scene=Scene_Map.new
when 2
@who= @userlist_window.data2[@userlist_window.index]
Network::Main.socket.send("TOID|#{@who}|<10>self.raise_player('#{@who}')</10>|<->")
$scene=Scene_Map.new
when 3
Network::Main.socket.send("TOID|#{@who}|<10>raise_all</10>|<->")
$scene=Scene_Map.new
when 4
@number_x_window.active=true
@command_window.active=false
when 5
@number_x_window.active=true
@command_window.active=false
when 6
@number_x_window.active=true
@command_window.active=false
when 7
@number_x_window.active=true
@command_window.active=false
when 8
@number_x_window.active=true
@command_window.active=false
when 9
@number_x_window.active=true
@command_window.active=false
when 10
@number_x_window.active=true
@command_window.active=false
when 11
@number_x_window.active=true
@command_window.active=false
when 12
@number_x_window.active=true
@command_window.active=false
end
return
end
if Input.trigger?(Input::R)
@command_window.active=false
@userlist_window.active=true
end
end
#--------------------------------------------------------------------------
# * Frame Update (when status window is active)
#--------------------------------------------------------------------------
def update_status
if Input.trigger?(Input::C)
@command_window.active=true
@userlist_window.active=false
end
end
def update_enter
if Input.trigger?(Input::C)
case @command_window.index
when 4
@who= @userlist_window.data2[@userlist_window.index]
@data= @number_x_window.number
Network::Main.socket.send("TOID|#{@who}|<10>self.map_player('#{@who}',#{@data})</10>|<->")
when 5
@who= @userlist_window.data2[@userlist_window.index]
@data= @number_x_window.number
Network::Main.socket.send("TOID|#{@who}|<10>self.x_player('#{@who}',#{@data})</10>|<->")
when 6
@who= @userlist_window.data2[@userlist_window.index]
@data= @number_x_window.number
Network::Main.socket.send("TOID|#{@who}|<10>self.y_player('#{@who}',#{@data})</10>|<->")
when 7
@who= @userlist_window.data2[@userlist_window.index]
@data= @number_x_window.number
Network::Main.socket.send("SW|#{@data}|true|<->")
when 8
@who= @userlist_window.data2[@userlist_window.index]
@data= @number_x_window.number
Network::Main.socket.send("SW|#{@data}|false|<->")
when 9
@who= @userlist_window.data2[@userlist_window.index]
@data= @number_x_window.number
Network::Main.socket.send("TOID|#{@who}|<10>self.gain_item('#{@who}',#{@data})</10>|<->")
when 10
@who= @userlist_window.data2[@userlist_window.index]
@data= @number_x_window.number
Network::Main.socket.send("TOID|#{@who}|<10>self.gain_weapon('#{@who}',#{@data})</10>|<->")
when 11
@who= @userlist_window.data2[@userlist_window.index]
@data= @number_x_window.number
Network::Main.socket.send("TOID|#{@who}|<10>self.gain_armor('#{@who}',#{@data})</10>|<->")
when 12
@who= @userlist_window.data2[@userlist_window.index]
@data= @number_x_window.number
Network::Main.socket.send("TOID|#{@who}|<10>self.gain_gold('#{@who}',#{@data})</10>|<->")
end
$scene=Scene_Map.new
end
end
end