Aldeia RPG

Gostaria de reagir a esta mensagem? Crie uma conta em poucos cliques ou inicie sessão para continuar.

Suporte ao desenvolvimento de jogos


5 participantes

    [Resolvido]Erro no sistema de cash

    Winner
    Winner
    Iniciante
    Iniciante


    Mensagens : 54
    Créditos : 1

    [Resolvido]Erro no sistema de cash Empty [Resolvido]Erro no sistema de cash

    Mensagem por Winner Sex Abr 13, 2012 8:22 pm

    Bom pessoal eu fiz tudo correto do sistema do nanzim ( http://www.aldeiarpgbr.com/t3154-tutorial-aula-cash-system-avancado-loja-cash ) ,fiz a loja e talz deu tudo certo,porém quando eu dou F9 no game,e coloco o comando /cash jogador quantidade , num funfa e o do gold também,alguem poderia me ajudar a resolver isso?eu clico OK e não acontece nada.


    Última edição por flashman em Sáb Abr 14, 2012 2:29 am, editado 1 vez(es)
    superleo12
    superleo12
    Novato
    Novato


    Mensagens : 3
    Créditos : 0

    [Resolvido]Erro no sistema de cash Empty Re: [Resolvido]Erro no sistema de cash

    Mensagem por superleo12 Sex Abr 13, 2012 8:28 pm

    Loool CARA :) tamo junto kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk eu nun sei cara se eu soube-se te falava leozin aquie :)


    _________________
    [Resolvido]Erro no sistema de cash Images?q=tbn:ANd9GcR0O-zFhe0j1WJoK5GcA6t99nPkwR3dKYDpBtcB89kySfLsrWZDfw
    Winner
    Winner
    Iniciante
    Iniciante


    Mensagens : 54
    Créditos : 1

    [Resolvido]Erro no sistema de cash Empty Re: [Resolvido]Erro no sistema de cash

    Mensagem por Winner Sex Abr 13, 2012 8:48 pm

    Consegui Resolver isso,porém agora quando eu dou Ok aparece essa mensagem:
    Script "[SYS] MAX_ITEM' LINE 32: Syntaxerro Ocurred
    Satheios
    Satheios
    Aldeia Friend
    Aldeia Friend


    Medalhas : [Resolvido]Erro no sistema de cash Trophy12[Resolvido]Erro no sistema de cash IlSfE
    Mensagens : 1248
    Créditos : 306

    [Resolvido]Erro no sistema de cash Empty Re: [Resolvido]Erro no sistema de cash

    Mensagem por Satheios Sex Abr 13, 2012 9:19 pm

    Esse erro sim acontece, o tutorial tem algum erro.
    Mas o player recebe o tal CASH e pra ele nao da o bug, só pro adm Wink


    _________________



    Ninguém pode ser perfeito, mas todos podem ser melhores.
    Visite o meu projeto, Tales of a Kingdom e prepare-se para um novo mundo!




    wallace123
    wallace123
    Aldeia Friend
    Aldeia Friend


    Medalhas : [Resolvido]Erro no sistema de cash 94Jxv[Resolvido]Erro no sistema de cash ICU4UuCrHDm5A[Resolvido]Erro no sistema de cash Ibnth6gSDk98m7[Resolvido]Erro no sistema de cash ZgLkiRU
    Mensagens : 1161
    Créditos : 38

    [Resolvido]Erro no sistema de cash Empty Re: [Resolvido]Erro no sistema de cash

    Mensagem por wallace123 Sex Abr 13, 2012 11:37 pm

    eu testei o sistema várias e várias vezes e nunca deu erro, testei até com duas janelas de jogo aberta


    _________________
    https://www.facebook.com/wallace.o.b
    Curta, interaja, compartilhe. :)
    Winner
    Winner
    Iniciante
    Iniciante


    Mensagens : 54
    Créditos : 1

    [Resolvido]Erro no sistema de cash Empty Re: [Resolvido]Erro no sistema de cash

    Mensagem por Winner Sáb Abr 14, 2012 12:17 am

    Poderia disponibilizar a Demo pra Download?o do Nanzim ta off o link.


    _________________
    Projetos:
    [Resolvido]Erro no sistema de cash Logo
    Acesse o Blog
    Acesse também o Forum
    wallace123
    wallace123
    Aldeia Friend
    Aldeia Friend


    Medalhas : [Resolvido]Erro no sistema de cash 94Jxv[Resolvido]Erro no sistema de cash ICU4UuCrHDm5A[Resolvido]Erro no sistema de cash Ibnth6gSDk98m7[Resolvido]Erro no sistema de cash ZgLkiRU
    Mensagens : 1161
    Créditos : 38

    [Resolvido]Erro no sistema de cash Empty Re: [Resolvido]Erro no sistema de cash

    Mensagem por wallace123 Sáb Abr 14, 2012 12:19 am

    ixi... Vai demorar um pouquinho porque eu usei a demo no projeto nem copiei o script kkk mas acho que tenho aqui na área de transferências.


    _________________
    https://www.facebook.com/wallace.o.b
    Curta, interaja, compartilhe. :)
    Winner
    Winner
    Iniciante
    Iniciante


    Mensagens : 54
    Créditos : 1

    [Resolvido]Erro no sistema de cash Empty Re: [Resolvido]Erro no sistema de cash

    Mensagem por Winner Sáb Abr 14, 2012 12:26 am

    Ok,Poste por favor,preciso muito pro meu projeto de Naruto Game.


    _________________
    Projetos:
    [Resolvido]Erro no sistema de cash Logo
    Acesse o Blog
    Acesse também o Forum
    Maverick ~
    Maverick ~
    Membro Ativo
    Membro Ativo


    Mensagens : 372
    Créditos : 39

    [Resolvido]Erro no sistema de cash Empty Re: [Resolvido]Erro no sistema de cash

    Mensagem por Maverick ~ Sáb Abr 14, 2012 1:03 am

    é o seguinte,é a coisa que qualquer scripter
    iniciante notaria... rsrs'
    O Erro é que na linha que faz com que envia o cash para o servidor
    o nanzin deixou escrito o cash "errado" copie o network abaixo e ve se
    funciona,se não funcionar me contacte


    Código:
    #===============================================================================
    # ** Network - Manages network data.
    #-------------------------------------------------------------------------------
    # Author    Me™ and Mr.Mo
    # Modified  Marlos Gama
    # Version  2.0
    # Date      11-04-06
    # Modified² Nanzin
    #Corrigied LSK
    #===============================================================================
    SDK.log("Network", "Mr.Mo and Me™", "1.0", " 11-04-06")

    p "TCPSocket script not found (class Network)" if not SDK.state('TCPSocket')
    #-------------------------------------------------------------------------------
    # Begin SDK Enabled Check
    #-------------------------------------------------------------------------------
    if SDK.state('TCPSocket') == true and SDK.state('Network')

    module Network
     
    class Main
     
      #--------------------------------------------------------------------------
      # * Attributes
      #--------------------------------------------------------------------------
      attr_accessor :socket
      attr_accessor :pm
      # getpm, pmname, writepm
     
      # AUTHENFICATION  = 0    => Authenficates
      # ID_REQUEST      = 1    => Returns ID
      # NAME_REQUEST    = 2    => Returns UserName
      # GROUP_REQUEST  = 3    => Returns Group
      # CLOSE          = 4    => Close, Stop Connection
      # NET_PLAYER      = 5    => Netplayers Data
      # MAP_PLAYER      = 6    => Mapplayers Data
      # KICK            = 7    => Kick a Player
      # KICK ALL        = 8    => Kick all Players
      # REMOVE          = 9    => Remove Player (CLOSE SYNONYM)
      # SYSTEM          = 10    => System (Var's and Switches)
      # MOD_CHANGE      = 11    => Message ot Day Change
      # TRADE          = 12    => Trade
      # PRIVATE_CHAT    = 13    => Private Chat
      #                = 14
      # POKE            = 15    => Poke Player
      # SLAP            = 16    => Decrease HP or SP PLayer
      # SLAP ALL        = 17    => Decrease Hp or SP ALL
      # ADM - MOD      = 18    => Admin/Mod Command Returns
      #                = 19
      # TEST STOP      = 20    => Connection Test End
     
      #--------------------------------------------------------------------------
      # * Initialiation
      #--------------------------------------------------------------------------
      def self.initialize
        @players    = {}
        @mapplayers = {}
        @netactors  = {}
        @pm = {}
        @pm_lines = []
        @user_test  = false
        @user_exist = false
        @socket    = nil
        @nooprec    = 0
        @id        = -1
        @name      = ""
        @group      = ""
        @status    = ""
        @oldx      = -1
        @oldy      = -1
        @oldd      = -1
        @oldp      = -1
        @oldid      = -1
        @login      = false
        @pchat_conf = false
        @send_conf  = false
        @trade_conf = false
        @servername = ""
        @pm_getting = false
        @self_key1 = nil
        @self_key2 = nil
        @self_key3 = nil
        @self_value = nil
        @trade_compelete = false
        @trading = false
        @trade_id = -1
        $party = Net_Party.new
      end
      #--------------------------------------------------------------------------
      # * Returns Servername
      #--------------------------------------------------------------------------
      def self.servername
        return @servername.to_s
      end
      #--------------------------------------------------------------------------
      # * Returns Socket
      #--------------------------------------------------------------------------
      def self.socket
        return @socket
      end
      #--------------------------------------------------------------------------
      # * Returns UserID
      #--------------------------------------------------------------------------
      def self.id
        return @id
      end
      #--------------------------------------------------------------------------
      # * Returns UserName
      #--------------------------------------------------------------------------
      def self.name
        return @name
      end 
      #--------------------------------------------------------------------------
      # * Returns current Status
      #--------------------------------------------------------------------------
      def self.status
        return "" if @status == nil or @status == []
        return @status
      end
      #--------------------------------------------------------------------------
      # * Returns Group
      #--------------------------------------------------------------------------
      def self.group
        if @group.downcase.include?("adm")
          group = "admin"
        elsif @group.downcase.include?("mod")
          group = "mod"
        else
          group = "standard"
        end
        return group
      end
      #--------------------------------------------------------------------------
      # * Returns Mapplayers
      #--------------------------------------------------------------------------
      def self.mapplayers
        return {} if @mapplayers == nil
        return @mapplayers
      end
      #--------------------------------------------------------------------------
      # * Returns NetActors
      #--------------------------------------------------------------------------
      def self.netactors
        return {} if @netactors == nil
        return @netactors
      end
      #--------------------------------------------------------------------------
      # * Returns Players
      #--------------------------------------------------------------------------
      def self.players
        return {} if @players == nil
        return @players
      end
      def self.map_empty?(map_id)
        for p in @players.values
          next if p.nil?
          if p.map_id == map_id || $game_map.map_id == map_id
            return false
          end
        end
        return true
      end
      def self.map_number(map_id)
        n = 0
        for p in @players.values
          next if p.nil?
          if p.map_id == map_id
            n += 1
          end
        end
        if $game_map.map_id == map_id
          n += 1
        end
        return n
      end
      def self.stone_team(team)
        a = []
        b = []
        for p in @players.values
          next if p.nil?
          if p.map_id == 399
            if p.x < 9
              a.push(p)
            else
              b.push(p)
            end
          end
        end
        if $game_player.x < 9
          a.push(p)
        else
          b.push(p)
        end
        if team == 1
          return a
        else
          return b
        end
      end
      #--------------------------------------------------------------------------
      # * Destroys player
      #--------------------------------------------------------------------------
      def self.destroy(id)
        !if $party.empty?
          for i in 0..$party.members.size
            if $party.members[i] != nil
              name = $game_party.actors[0].name
              Network::Main.pchat($party.members[i].netid,"[COM] [ET] #{name}")
              Network::Main.pchat($party.members[i].netid,"#{name} saiu da party!")
              #$Hud_Party.visible = false
              #$Hud_Party.active = false
            end
          end
        end
        $party.party_exit
        @players[id.to_s] = nil rescue nil
        @mapplayers[id.to_s] = "" rescue nil
        for player in @mapplayers
          @mapplayers.delete(id.to_s) if player[0].to_i == id.to_i
        end
        for player in @players
          @players.delete(id.to_s) if player[0].to_i == id.to_i
        end
        if $scene.is_a?(Scene_Map)
          begin
            $scene.spriteset[id].dispose unless $scene.spriteset[id].disposed?
          rescue
            nil
          end
        end
      end
      #--------------------------------------------------------------------------
      # * Create A socket
      #--------------------------------------------------------------------------
      def self.start_connection(host, port)
        @socket = TCPSocket.new(host, port)
      end
      #--------------------------------------------------------------------------
      # * Asks for Id
      #--------------------------------------------------------------------------
      def self.get_id
        @socket.send("<1>'req'</1>\n")
      end
      #--------------------------------------------------------------------------
      # * Asks for name
      #--------------------------------------------------------------------------
      def self.get_name
        @socket.send("<2>'req'</2>\n")
      end
      #--------------------------------------------------------------------------
      # * Asks for Group
      #--------------------------------------------------------------------------
      def self.get_group
        #@socket.send("<3>'req'</3>\n")
        @socket.send("<check>#{self.name}</check>\n")
      end
      #--------------------------------------------------------------------------
      # * Registers (Attempt to)
      #--------------------------------------------------------------------------
      def self.send_register(user,pass)
        # Register with User as name, and Pass as password
        @socket.send("<reges #{user}>#{pass}</reges>\n")
        # Start Loop for Retrival
        loop = 0
          loop do
          loop += 1
          self.update
          # Break If Registration Succeeded
          break if @registered
          # Break if Loop reached 10000
          break if loop == 10000
        end
      end
      #--------------------------------------------------------------------------
      # * Asks for Network Version Number
      #--------------------------------------------------------------------------
      def self.retrieve_version
        @socket.send("<ver>#{User_Edit::VERSION}</ver>\n")
      end
      #--------------------------------------------------------------------------
      # * Asks for Message of the day
      #--------------------------------------------------------------------------
      def self.retrieve_mod
        @socket.send("<mod>'request'</mod>\n")
      end
      #--------------------------------------------------------------------------
      # * Asks for Login (and confirmation)
      #--------------------------------------------------------------------------
      def self.send_login(user,pass)
        @socket.send("<login #{user}>#{pass}</login>\n")
      end
      #--------------------------------------------------------------------------
      # * Send Errors
      #--------------------------------------------------------------------------
      def self.send_error(lines)
        if lines.is_a?(Array)
          for line in lines
            @socket.send("<err>#{line}</err>\n")
          end
        elsif lines.is_a?(String)
          @socket.send("<err>#{lines}</err>\n")
        end
      end 
      #--------------------------------------------------------------------------
      # * Authenfication
      #--------------------------------------------------------------------------
      def self.amnet_auth
        # Send Authenfication
        @socket.send("<0>'e'</0>\n")
        @auth = false
        # Set Try to 0, then start Loop
        try = 0
        loop do
          # Add 1 to Try
          try += 1
          loop = 0
          # Start Loop for Retrieval
          loop do
            loop += 1
            self.update
            # Break if Authenficated
            break if @auth
            # Break if loop reaches 20000
            break if loop == 20000
          end
          # If the loop was breaked because it reached 10000, display message
          p "#{User_Edit::NOTAUTH}, Tentativa #{try} de #{User_Edit::CONNFAILTRY}" if loop == 20000
          # Stop everything if try mets the maximum try's
          break if try == User_Edit::CONNFAILTRY
          # Break loop if Authenficated
          break if @auth
        end
        # Go to Scene Login if Authenficated
        $scene = Scene_Login.new if @auth
      end
      #--------------------------------------------------------------------------
      # * Send Start Data
      #--------------------------------------------------------------------------
      def self.send_start
        send = ""
        # Send Username And character's Graphic Name
        send += "@username = '#{self.name}'; @character_name = '#{$game_player.character_name}';"
        # Send guild of the player
        send += "@guild = '#{$guild_name.to_s}';"
        # Send gold
        send += "@gold = '#{$game_party.item_number(Item_Ouro::Item_Id.to_i).to_s}';"
        # Send Cash
        send += "@cash = '#{$game_party.item_number(Item_Cash::Cash_Id.to_i).to_s}';"
        # Send guild position of the player
        send += "@position = '#{$guild_position.to_s}';"
        # Send bandeira of the guild player
        send += "@flag = '#{$flag.to_s}';"
        # Send grupo of the player
        send += "@grupo = '#{$game_party.actors[0].grupo}';"
        # Send status ban of the player
        send += "@ban = '#{$game_party.actors[0].ban}';"
        # Send map mensage
        send += "@chat_text = '#{$chat_text.to_s}';"
        # Send level info
        send += "@level_info = '#{$level_info.to_s}';"
        # Send Exp
        send += "@now_exp = '#{$game_party.actors[0].now_exp}';"
        send += "@next_exp = '#{$game_party.actors[0].next_exp}';"
        # Send genero
        send += "@sexo = '#{$game_party.actors[0].sexo}';"
        # Sends Map ID, X and Y positions
        send += "@map_id = #{$game_map.map_id}; @x = #{$game_player.x}; @y = #{$game_player.y};"
        # Sends Name
        send += "@nome = '#{$game_party.actors[0].name}';" if User_Edit::Bandwith >= 1
        # Sends Direction
        send += "@direction = #{$game_player.direction};" if User_Edit::Bandwith >= 2
        # Sends Move Speed
        send += "@move_speed = #{$game_player.move_speed};" if User_Edit::Bandwith >= 3
        # Sends Requesting start
        send += "@weapon_id = #{$game_party.actors[0].weapon_id};"
        send += "@armor1_id = #{$game_party.actors[0].armor1_id};"
        send += "@armor2_id = #{$game_party.actors[0].armor2_id};"
        send += "@armor3_id = #{$game_party.actors[0].armor3_id};"
        send += "@armor4_id = #{$game_party.actors[0].armor4_id};"
        send += "@str = #{$game_party.actors[0].str};"
        send += "@agi = #{$game_party.actors[0].agi};"
        send += "@dex = #{$game_party.actors[0].dex};"
        send += "@int = #{$game_party.actors[0].int};"
        send += "@arma_n = '#{$arma_n.to_s}';"
        send += "@escudo_n = '#{$escudo_n.to_s}';"
        #if $data_weapons[$game_party.actors[0].weapon_id] != nil
        #send += "@arma_atk = #{$data_weapons[$game_party.actors[0].weapon_id].name};"
        #end
        #if $data_armors[$game_party.actors[0].armor1_id] != nil
        #send += "@escudo_def = #{$data_armors[$game_party.actors[0].armor1_id].name};"
        #end
        send += "start(#{self.id});"
        @socket.send("<5>#{send}</5>\n")
        self.send_newstats
        #send_actor_start
      end
    #--------------------------------------------------------------------------
      # * Return PMs
      #-------------------------------------------------------------------------
      def self.pm
        return @pm
      end
      #--------------------------------------------------------------------------
      # * Get PMs
      #--------------------------------------------------------------------------
      def self.get_pms
        @pm_getting = true
        @socket.send("<22a>'Get';</22a>\n")
      end
    #--------------------------------------------------------------------------
      # * Update PMs
      #--------------------------------------------------------------------------
      def self.update_pms(message)
      #Starts all the variables
      @pm = {}
      @current_Pm = nil
      @index = -1
      @message = false
      #Makes a loop to look thru the message
      for line in message
        #If the line is a new PM
        if line == "$NEWPM"
          @index+=1
          @pm[@index] = Game_PM.new(@index)
          @message = false
          #if the word has $to_from
        elsif line == "$to_from" and @message == false
          to_from = true
          #if the word has $subject
        elsif line == "$Subject" and @message == false
          subject = true
          #if the word has $message
        elsif line == "$Message" and @message == false
          @message = true
        elsif @message
          @pm[@index].message += line+"\n"
        elsif to_from
          @pm[@index].to_from = line
          to_from = false
        elsif subject
          @pm[@index].subject = line
          subject = false
        end
      end
      @pm_getting = false
     end
      #--------------------------------------------------------------------------
      # * Checks if the PM is still not get.
      #--------------------------------------------------------------------------
      def self.pm_getting
        return @pm_getting
      end
      #--------------------------------------------------------------------------
      # * Write PMs
      #--------------------------------------------------------------------------
      def self.write_pms(message)
        send = message
        @socket.send("<22d>#{send}</22d>\n")
      end
      #--------------------------------------------------------------------------
      # * Delete All PMs
      #--------------------------------------------------------------------------
      def self.delete_all_pms
        @socket.send("<22e>'delete'</22e>\n")
        @pm = {}
      end
      #--------------------------------------------------------------------------
      # * Delete pm(id)
      #--------------------------------------------------------------------------
      def self.delete_pm(id)
        @pm.delete(id)
      end
      #--------------------------------------------------------------------------
      # * Delete MapPlayers
      #--------------------------------------------------------------------------
      def self.mapplayers_delete
        @mapplayers = {}
      end
      #--------------------------------------------------------------------------
      # * Update Guild
      #--------------------------------------------------------------------------
      def self.update_guild
        contents = "@guild = '#{$guild_name.to_s}';"
        @socket.send("<5>#{contents}</5>\n")
      end
      #--------------------------------------------------------------------------
      # * Send Requested Data
      #--------------------------------------------------------------------------
      def self.send_start_request(id)
        send = ""
        # Send Username And character's Graphic Name
        send += "@username = '#{self.name}'; @character_name = '#{$game_player.character_name}'; "
        # Sends Map ID, X and Y positions
        send += "@map_id = #{$game_map.map_id}; @x = #{$game_player.x}; @y = #{$game_player.y}; "
        # Sends Name
        send += "@nome = '#{$game_party.actors[0].name}'; " if User_Edit::Bandwith >= 1
        # Sends Direction
        send += "@direction = #{$game_player.direction}; " if User_Edit::Bandwith >= 2
        # Sends Move Speed
        send += "@move_speed = #{$game_player.move_speed};" if User_Edit::Bandwith >= 3
        send += "@weapon_id = #{$game_party.actors[0].weapon_id};"
        send += "@armor1_id = #{$game_party.actors[0].armor1_id};"
        send += "@armor2_id = #{$game_party.actors[0].armor2_id};"
        send += "@armor3_id = #{$game_party.actors[0].armor3_id};"
        send += "@armor4_id = #{$game_party.actors[0].armor4_id};"
        send += "@guild = '#{$guild_name.to_s}';"
        send += "@position = '#{$guild_position.to_s}';"
        send += "@flag = '#{$flag.to_s}';"
        send += "@grupo = '#{$game_party.actors[0].grupo}';"
        send += "@ban = '#{$game_party.actors[0].ban}';"
        send += "@chat_text = '#{$chat_text.to_s}';"
        send += "@sexo = '#{$game_party.actors[0].sexo}';"
        send += "@now_exp = '#{$game_party.actors[0].now_exp}';"
        send += "@next_exp = '#{$game_party.actors[0].next_exp}';"
        send += "@gold = '#{$game_party.item_number(Item_Ouro::Item_Id.to_i).to_s}';"
        send += "@cash = '#{$game_party.item_number(Item_Cash::Cash_Id.to_i).to_s}';"
        send += "@str = #{$game_party.actors[0].str};"
        send += "@agi = #{$game_party.actors[0].agi};"
        send += "@dex = #{$game_party.actors[0].dex};"
        send += "@int = #{$game_party.actors[0].int};"
        send += "@level_info = '#{$level_info.to_s}';"
        send += "@arma_n = '#{$arma_n.to_s}';"
        send += "@escudo_n = '#{$escudo_n.to_s}';"
        #if $data_weapons[$game_party.actors[0].weapon_id] != nil
        #send += "@arma_atk = #{$data_weapons[$game_party.actors[0].weapon_id].name};"
        #end
        #if $data_armors[$game_party.actors[0].armor1_id] != nil
        #send += "@escudo_def = #{$data_armors[$game_party.actors[0].armor1_id].name};"
        #end
        #@socket.send("<6a>#{id.to_i}</6a>\n")
        @socket.send("<5>#{send}</5>\n")
        #self.send_map
        #self.send_actor_start
      end
      #--------------------------------------------------------------------------
      # * Send Map Id data
      #--------------------------------------------------------------------------
      def self.send_map
        send = ""
        # Send Username And character's Graphic Name
        send += "@username = '#{self.name}'; @character_name = '#{$game_player.character_name}'; "
        # Sends Map ID, X and Y positions
        send += "@map_id = #{$game_map.map_id}; @x = #{$game_player.x}; @y = #{$game_player.y}; "
        # Sends Direction
        send += "@direction = #{$game_player.direction};" if User_Edit::Bandwith >= 2
        send += "@weapon_id = #{$game_party.actors[0].weapon_id};"
        send += "@armor1_id = #{$game_party.actors[0].armor1_id};"
        send += "@armor2_id = #{$game_party.actors[0].armor2_id};"
        send += "@armor3_id = #{$game_party.actors[0].armor3_id};"
        send += "@armor4_id = #{$game_party.actors[0].armor4_id};"
        @socket.send("<5>#{send}</5>\n")
        for player in @players.values
          next if player.netid == -1
          # If the Player is on the same map...
          if player.map_id == $game_map.map_id and self.in_range?(player)
            # Update Map Players
            self.update_map_player(player.netid, nil)
          elsif @mapplayers[player.netid.to_s] != nil
            # Remove from Map Players
            self.update_map_player(player.netid, nil, true)
          end
        end
      end
      #--------------------------------------------------------------------------
      # * Calls a player to trade
      #--------------------------------------------------------------------------
      def self.trade_call(id)
        @trade_compelete = false
        @trading = true
        @socket.send("<24>#{id}\n")
        ids = self.id
        @socket.send("<24c>@trade_id = #{ids}</24c>\n")
      end
      #--------------------------------------------------------------------------
      # * Exit trade.
      #--------------------------------------------------------------------------
      def self.trade_exit(id)
        @socket.send("<24>#{id}\n")
        ids = self.id
        @socket.send("<24d>trade_exit = #{ids}</24d>\n")
      end
      #--------------------------------------------------------------------------
      # * Checks if the trade is compelete
      #--------------------------------------------------------------------------
      def self.trade_compelete
        return @trade_compelete
      end
      #--------------------------------------------------------------------------
      # * Checks the trade result
      #--------------------------------------------------------------------------
      def self.trading
        return @trading
      end
      #--------------------------------------------------------------------------
      # * Send Move Update
      #--------------------------------------------------------------------------
      def self.trade_add(kind,item_id,netid)
        @socket.send("<25>#{netid}\n")
        me = self.id
        @socket.send("<25a>i_kind = #{kind}; i_id = #{item_id}; id = #{me};</25a>\n")
      end
      #--------------------------------------------------------------------------
      # * Send Move Update
      #--------------------------------------------------------------------------
      def self.trade_remove(kind,item_id,netid)
        @socket.send("<25>#{netid}\n")
        me = self.id
        @socket.send("<25b>i_kind = #{kind}; i_id = #{item_id}; id = #{me};</25b>\n")
      end
      #--------------------------------------------------------------------------
      # * Send Trade REquest
      #--------------------------------------------------------------------------
      def self.trade_request(netid)
        @socket.send("<25>#{netid}\n")
        me = self.id
        @socket.send("<25d>id = #{me};</25d>\n")
      end
      #--------------------------------------------------------------------------
      # * Send accept trade
      #--------------------------------------------------------------------------
      def self.trade_accept(netid)
        @socket.send("<25>#{netid}\n")
        me = self.id
        @socket.send("<25e>id = #{me};</25e>\n")
      end
      #--------------------------------------------------------------------------
      # * Send cancel trade
      #--------------------------------------------------------------------------
      def self.trade_cancel(netid)
        @socket.send("<25>#{netid}\n")
        me = self.id
        @socket.send("<25f>id = #{me};</25f>\n")
      end
      #--------------------------------------------------------------------------
      # * Send Move Update
      #--------------------------------------------------------------------------
      def self.send_move_change
        return if @oldx == $game_player.x and @oldy == $game_player.y
        return if @mapplayers == {}
        send = ""
        # Increase Steps if the oldx or the oldy do not match the new ones
        if User_Edit::Bandwith >= 1
          send += "ic;"  if @oldx != $game_player.x or @oldy != $game_player.y
        end
        # New x if x does not mathc the old one
        if @oldx != $game_player.x
          send += "@x = #{$game_player.x}; @tile_id = #{$game_player.tile_id};"
          @oldx = $game_player.x
        end
        # New y if y does not match the old one
        if @oldy != $game_player.y
          send += "@y = #{$game_player.y}; @tile_id = #{$game_player.tile_id};"
          @oldy = $game_player.y
        end
        # Send the Direction if it is different then before
        if User_Edit::Bandwith >= 2
          if @oldd != $game_player.direction
            send += "@direction = #{$game_player.direction};" 
            @oldd = $game_player.direction
          end
        end
        # Send everything that needs to be sended
        @socket.send("<5>#{send}</5>\n") if send != ""
      end
      #--------------------------------------------------------------------------
      # * Send Stats
      #--------------------------------------------------------------------------
      def self.send_newstats
        hp = $game_party.actors[0].hp
        maxhp = $game_party.actors[0].maxhp
        sp = $game_party.actors[0].sp
        maxsp = $game_party.actors[0].maxsp
        agi = $game_party.actors[0].agi
        eva = $game_party.actors[0].eva
        pdef = $game_party.actors[0].pdef
        mdef = $game_party.actors[0].mdef
        level = $game_party.actors[0].level
        a = $game_party.actors[0]
        c = "["
        m = 1
        for i in a.states
          next if $data_states[i] == nil
          c += i.to_s
          c += ", " if m != a.states.size
          m += 1
        end
        c += "]"
        stats = "@hp = #{hp}; @maxhp = #{maxhp}; @sp = #{sp};  @maxsp = #{maxsp}; @agi = #{agi}; @eva = #{eva}; @pdef = #{pdef}; @mdef = #{mdef}; @states = #{c}; @level = #{level}"
        @socket.send("<5>#{stats}</5>\n")
      end
      #--------------------------------------------------------------------------
      # * Send Gold
      #--------------------------------------------------------------------------
      def self.send_gold
        gold = $game_party.gold
        @socket.send("<5>@gold = #{gold}</5>\n")
      end
      #--------------------------------------------------------------------------
      # * Send Cash
      #--------------------------------------------------------------------------
      def self.send_cash
        cash = $game_party.cash
        @socket.send("<5>@cash = #{cash}</5>\n")
      end
      #--------------------------------------------------------------------------
      # * Close Socket
      #--------------------------------------------------------------------------
      def self.close_socket
        return if @socket == nil
        @socket.send("<9>#{self.id}</9>\n")
        #@socket.send("<4>'Close'</4>\n")
    #Se você fechar o jogo quando uma mensagem tiver aberta, quando retornar, ele não está travado
      if $game_temp.message_window_showing
        @message_window = Window_Message.new
        @message_window.terminate_message
      end
        if $scene.is_a?(Scene_Connect)
        end
        if $scene.is_a?(Scene_Login)
        end
        #if $scene.is_a?(Scene_Register)
        #end
        if $scene.is_a?(Scene_Title)
        end
        #No jogo
        if $scene.is_a?(Scene_Trade)
        salvar
        end
        if $scene.is_a?(Scene_PChat)
        salvar
        end
        if $scene.is_a?(Scene_Map)
        salvar
        if not $party.empty?
          for i in 0..$party.members.size
            if $party.members[i] != nil
              if $parte_s == true
              name = $game_party.actors[0].name
              Network::Main.pchat($charzinho_id,"[COM] [ET] #{name}")
              Network::Main.pchat($charzinho_id,"[COM] [EXIT] #{name}")
              Network::Main.pchat($charzinho_id,"#{name} saiu da party!")
              #$Hud_Party.visible = false
              #$Hud_Party.active = false
              else
              name = $game_party.actors[0].name
              Network::Main.pchat($party.members[i].netid,"[COM] [ET] #{name}")
              Network::Main.pchat($party.members[i].netid,"[COM] [EXIT] #{name}")
              Network::Main.pchat($party.members[i].netid,"#{name} saiu da party!")
              #$Hud_Party.visible = false
              #$Hud_Party.active = false
              end
            end
          end
        end
        end
        @socket.close
        @socket = nil
      end
      #--------------------------------------------------------------------------
      # * Change Messgae of the Day
      #--------------------------------------------------------------------------
      def self.change_mod(newmsg)
        @socket.send("<11>#{newmsg}</11>\n")
      end
      #--------------------------------------------------------------------------
      # * Private Chat Send
      #--------------------------------------------------------------------------
      def self.pchat(id,mesg)
        @pchat_conf = false
        # Send the Private Chat Id (without close!!! \<13a>)
        @socket.send("<13a>#{id}\n")
        # Send Priavte Chat Message
        @socket.send("<13>#{mesg}</13>\n") #if @pchat_conf
        #p "could not send #{mesg} to #{id}..." if not @pchat_conf
      end
      #--------------------------------------------------------------------------
      # * Private Chat Send
      #--------------------------------------------------------------------------
      def self.mchat(id,mesg)
        @mchat_conf = false
        # Send the Chat Id (without close!!! \<21a>)
        @socket.send("<21a>#{id}\n")
        # Send Chat Message
        @socket.send("<21>#{mesg}</21>\n")
      end
      #--------------------------------------------------------------------------
      # * Check if the user exists on the network..
      #--------------------------------------------------------------------------
      def self.user_exist?(username)
        # Enable the test
        @user_test  = true
        @user_exist = false
        # Send the data for the test
        self.send_login(username.to_s,"*test*")
        # Check for how to long to wait for data (Dependent on username size)
        if username.size <= 8
          # Wait 1.5 seconds if username is less then 8
          for frame in 0..(1.5*40)
            self.update
          end
        elsif username.size > 8 and username.size <= 15
          # Wait 2.3 seconds if username is less then 15
          for frame in 0..(2.3*40)
            self.update
          end
        elsif username.size > 15
          # Wait 3 seconds if username is more then 15
          for frame in 0..(3*40)
            self.update
          end
        end
        # Start Retreival Loop
        loop = 0
        loop do
          loop += 1
          self.update
          # Break if User Test was Finished
          break if @user_test == false
          # Break if loop meets 10000
          break if loop == 10000
        end
        # If it failed, display message
        p User_Edit::USERTFAIL if loop == 10000
        # Return User exists if failed, or if it exists
        return true if @user_exist or loop == 10000
        return false
      end
      #--------------------------------------------------------------------------
      # * Trade
      #--------------------------------------------------------------------------
      def self.trade(id,type,item,num=1,todo='gain')
        # Gain is used for normal trade,
        # Lose is used as Admin Command
        # Check if you got item
        case type
        when 0
          got = $game_party.item_number(item)
        when 1
          got = $game_party.weapon_number(item)
        when 2
          got = $game_party.armor_number(item)
        end
        # Print if not, return
        p "#{User_Edit::DONTGOTTRADE} (trade: kind = #{type} id = #{item})" if got == 0 and todo == 'gain'
        return if got == 0 and todo == 'gain'
        p "#{User_Edit::NOTENOUGHTRADE} (trade: kind = #{type} id = #{item})" if got < num and todo == 'gain'
        return if got < num and todo == 'gain'
        @pchat_conf = false
        # Send the Trade Id (without close!!! \<12a>)
        @socket.send("<12a>#{id}\n")
        @socket.send("<12>type=#{type} item=#{item} num=#{num} todo=#{todo}</12>\n")
          case type
          when 0
            $game_party.lose_item(item,num) if todo == 'gain'
          when 1
            $game_party.lose_weapon(item, num)  if todo == 'gain'
          when 2
            $game_party.lose_armor(item, num)  if todo == 'gain'
          end
      end
      #--------------------------------------------------------------------------
      # * Send Result
      #--------------------------------------------------------------------------
      def self.send_result(id)
        @socket.send("<result_id>#{id}</result_id>\n")
        @socket.send("<result_effect>#{self.id}</result_effect>\n")
      end
      #--------------------------------------------------------------------------
      # * Send Dead
      #--------------------------------------------------------------------------
      def self.send_dead
        @socket.send("<9>#{self.id}</9>\n")
      end
      #--------------------------------------------------------------------------
      # * Update Net Players
      #--------------------------------------------------------------------------
      def self.update_net_player(id, data)
        # Turn Id in Hash into Netplayer (if not yet)
        @players[id] ||= Game_NetPlayer.new
        # Set the Global NetId if it is not Set yet
        @players[id].do_id(id) if @players[id].netid == -1
        # Refresh -> Change data to new data
        @players[id].refresh(data)     
        # Return if the Id is Yourself
        return if id.to_i == self.id.to_i
        # Return if you are not yet on a Map
        return if $game_map == nil
        # If the Player is on the same map...
        if @players[id].map_id == $game_map.map_id
          # Update Map Players
          self.update_map_player(id, data)
        elsif @mapplayers[id] != nil
          # Remove from Map Players
          self.update_map_player(id, data, true)
        end
      end
      #--------------------------------------------------------------------------
      # * Update Map Players
      #--------------------------------------------------------------------------
      def self.update_map_player(id, data, kill=false)
        # Return if the Id is Yourself
        return if id.to_i == self.id.to_i
        # If Kill (remove) is true...
        if kill and @mapplayers[id] != nil
          # Delete Map Player
          @mapplayers.delete(id.to_i) rescue nil
          if $scene.is_a?(Scene_Map)
            $scene.spriteset.delete(id.to_i) rescue nil
          end
          $game_temp.spriteset_refresh = true
          return
        end
        g = @mapplayers[id]
        @mapplayers[id] ||= @players[id] if @players[id] != nil
        # Turn Id in Hash into Netplayer (if not yet)
        @mapplayers[id] ||= Game_NetPlayer.new
        # Set the Global NetId if it is not Set yet
        @mapplayers[id].netid = id if @mapplayers[id].netid == -1
        # Refresh -> Change data to new data
        @mapplayers[id].refresh(data)
        #Send the player's new stats
        self.send_newstats if g == nil
      end
      #--------------------------------------------------------------------------
      # * Update Net Actors
      #--------------------------------------------------------------------------
      def self.update_net_actor(id,data,actor_id)
        return
        return if id.to_i == self.id.to_i
        # Turn Id in Hash into Netplayer (if not yet)
        @netactors[id] ||= Game_NetActor.new(actor_id)
        # Set the Global NetId if it is not Set yet
        @netactors[id].netid = id if @netactors[id].netid == -1
        # Refresh -> Change data to new data
        @netactors[id].refresh(data)
      end
      #--------------------------------------------------------------------------
      # * Update
      #--------------------------------------------------------------------------
      def self.update
        # If Socket got lines, continue
        return unless @socket.ready?
        for line in @socket.recv(0xfff).split("\n")
          @nooprec += 1 if line.include?("\000\000\000\000")
          return if line.include?("\000\000\000\000")
          p "#{line}" unless line.include?("<5>") or line.include?("<6>")or not $DEBUG or not User_Edit::PRINTLINES
          # Set Used line to false
          updatebool = false
          #Update Walking
          updatebool = self.update_walking(line) if @login and $game_map != nil
          # Update Ingame Protocol, if LogedIn and Map loaded
          updatebool = self.update_ingame(line)  if updatebool == false and @login and $game_map != nil
          # Update System Protocol, if command is not Ingame
          updatebool = self.update_system(line)  if updatebool == false
          # Update Admin/Mod Protocol, if command is not System
          updatebool = self.update_admmod(line)  if updatebool == false
          # Update Outgame Protocol, if command is not Admin/Mod
          updatebool = self.update_outgame(line) if updatebool == false
        end
      end
      #--------------------------------------------------------------------------
      # * Update Admin and Mod Command Recievals -> 18
      #--------------------------------------------------------------------------
      def self.update_admmod(line)
        case line
        # Admin Command Recieval
        when /<18>(.*)<\/18>/
          # Kick All Command
          if $1.to_s == "kick_all"
            p User_Edit::ADMKICKALL
            self.close_socket
            $scene = nil
            return true
          # Kick Command
          elsif $1.to_s == "kicked"
            p User_Edit::ADMKICK
            self.close_socket
            $scene = nil
            return true
          end
        return false
        end
        return false
      end
      #--------------------------------------------------------------------------
      # * Update all Not-Ingame Protocol Parts -> 0, login, reges
      #--------------------------------------------------------------------------
      def self.update_outgame(line)
        case line
        # Server Authenfication
        when /<0 (.*)>(.*) n=(.*)<\/0>/
          a = self.authenficate($1,$2)
          @servername = $3.to_s
          return true if a
        # Registration Conformation
        when /<reges>(.*)<\/reges>/
          @user_test = false
          return true
        # Login, With User Test
        when /<login>(.*)<\/login>/
          if not @user_test
            # When Log in Succeeded, and not User Test...
            if $1 == "allow" and not @user_test
              # Login and Status to Logged-in
              @login = true
              @status = User_Edit::LOGIN_STATUS
              text = [@status]
              $scene.set_status(@status) if $scene.is_a?(Scene_Login)
              # Get Name (By Server)
              self.get_name
              # Start Loop for Retrieval
              loop = 0
              loop do
                self.update
                loop += 1
                # Break if loop reaches 10000
                break if loop == 10000
                # Break if Name and ID are recieved
                break if self.name != "" and self.name != nil and self.id != -1
              end
              self.get_group
              # Goto Scene Title
              $scene = Scene_Title.new
              return true
            # When Wrong Username and not User Test
            elsif $1 == "wu" and not @user_test
              # Set status to Incorrect Username
              @status = User_Edit::LOGIN_USERERROR
              $scene.set_status(@status) if $scene.is_a?(Scene_Login)
              return true
            # When Wrong Password and not User Test
            elsif $1 == "wp" and not @user_test
              # Set status to Incorrect Passowrd
              @status = User_Edit::LOGIN_PASSERROR
              $scene.set_status(@status) if $scene.is_a?(Scene_Login)
              return true
            # When Other Command, and Not User test
            elsif not @user_test
              # ERROR!
              @status = User_Edit::UNEXPECTLOGERR
              p @status
              return true
            end
          # If it IS a user test...
          else
            @user_exist = false
            #...and wrong user -> does not exist
            if $1 == "wu"
              # User does not Exist
              @user_exist = false
              @user_test = false
            #...and wrong pass -> does exist
            elsif $1 == "wp"
              # User Does Exist
              @user_exist = true
              @user_test = false
            end
            return true
          end
          return false
        end
        return false
      end
      #--------------------------------------------------------------------------
      # * Update System Protocol Parts -> ver, mod, 1, 2, 3, 10
      #--------------------------------------------------------------------------
      def self.update_system(line)
        case line
        # Version Recieval
        when /<ver>(.*)<\/ver>/
          $game_temp.msg = User_Edits::VER_ERROR if $1.to_s == nil
          @version = $1.to_s if $1.to_s != nil
          return true
        # Message Of the Day Recieval
        when /<mod>(.*)<\/mod>/
          $game_temp.motd = $1.to_s
          return true
        # User ID Recieval (Session Based)
        when /<1>(.*)<\/1>/
          @id = $1.to_s
          return true
        # User Name Recieval
        when /<2>(.*)<\/2>/
       


    _________________
    Alguma Duvida!? Me mande uma MP

    [Resolvido]Erro no sistema de cash BgIconeLivro                 Regras do Fórum


    [Resolvido]Erro no sistema de cash L4thF
    Maverick ~
    Maverick ~
    Membro Ativo
    Membro Ativo


    Mensagens : 372
    Créditos : 39

    [Resolvido]Erro no sistema de cash Empty Re: [Resolvido]Erro no sistema de cash

    Mensagem por Maverick ~ Sáb Abr 14, 2012 1:04 am

    Código:
     @name = $1.to_s
          return true
        # Group Recieval
        when /<3>(.*)<\/3>/
          @group = $1.to_s
          return true
        when /<check>(.*)<\/check>/
          @group = $1.to_s
          return true
        # System Update
        when /<10>(.*)<\/10>/
          return true if $1.match(/File|system|`/)
          return true if $1.nil?
          eval($1)
          $game_map.need_refresh = true
          return true
        when /<23>(.*)<\/23>/
          eval($1)
          key = []
          key.push(@self_key1)
          key.push(@self_key2)
          key.push(@self_key3)
          $game_self_switches[key] = @self_value
          @self_key1 = nil
          @self_key2 = nil
          @self_key3 = nil
          @self_value = nil
          $game_map.need_refresh = true
          key = []
          return true
        end
        return false
      end
      #--------------------------------------------------------------------------
      # * Update Walking
      #--------------------------------------------------------------------------
      def self.update_walking(line)
        case line
        # Player information Processing
        when /<player id=(.*)>(.*)<\/player>/
          self.update_net_player($1, $2)
          return true
        # Player Processing
        when /<5 (.*)>(.*)<\/5>/
          # Update Player
          self.update_net_player($1, $2)
          # If it is first time connected...
          return true if !$2.include?("start")
          # ... and it is not yourself ...
          return true if $1.to_i == self.id.to_i
          # ... and it is on the same map...
          return true if @players[$1].map_id != $game_map.map_id
          # ...  Return the Requested Information
          return true if !self.in_range?(@players[$1])
          self.send_start_request($1.to_i)
          $game_temp.spriteset_refresh = true
        return true
        # Map PLayer Processing
        when /<6 (.*)>(.*)<\/6>/
          # Return if it is yourself
          return true if $1.to_i == self.id.to_i
          # Update Map Player
          #self.update_map_player($1, $2)
          self.update_net_player($1, $2)
          # If it is first time connected...
          if $2.include?("start") or $2.include?("map")
            # ... and it is not yourself ...
            return true if $1.to_i != self.id.to_i
            # ... and it is on the same map...
            return true if @players[$1].map_id != $game_map.map_id
            # ...  Return the Requested Information
            return true if !self.in_range?(@players[$1])
            self.send_start_request($1.to_i)
            $game_temp.spriteset_refresh = true
          end
          return true
        # Map PLayer Processing
        when /<netact (.*)>data=(.*) id=(.*)<\/netact>/
          # Return if it is yourself
          return true if $1.to_i == self.id.to_i
          # Update Map Player
          self.update_net_actor($1, $2, $3)
          return true
        when /<state>(.*)<\/state>/
          $game_party.actors[0].refresh_states($1)
        # Attacked!
        when /<attack_effect>dam=(.*) ani=(.*) id=(.*) map=(.*)<\/attack_effect>/
          return if $4.to_i != $game_map.map_id
          $game_party.actors[0].hp -= $1.to_i if $1.to_i > 0 and $1 != "Miss"
          #$game_player.jump(0, 0) if $1.to_i > 0 and $1 != "Miss"
          $game_player.animation_id = $2.to_i if $1.to_i > 0 and $1 != "Miss"
          if User_Edit::VISUAL_EQUIP_ACTIVE == true
          actor = $game_party.actors[0]
          actor.damage = $1.to_i if $1.to_i > 0 and $1 != "Miss"
          else
          $game_player.show_demage($1.to_i,false) if $1.to_i > 0 and $1 != "Miss"
          end
          self.send_newstats
          if $game_party.actors[0].hp <= 0 or $game_party.actors[0].dead?
            self.send_result($3.to_i)
            self.send_dead
           
            #$assassinato = true
    =begin
          if !$party.empty?
          for i in 0..$party.members.size
            if $party.members[i] != nil
              if $parte_s == true
              name = $game_party.actors[0].name
              Network::Main.pchat($charzinho_id,"[COM] [ET] #{name}")
              Network::Main.pchat($charzinho_id,"[COM] [EXIT] #{name}")
              #Network::Main.pchat($charzinho_id,"#{name} foi assassinado e saiu da party!")
              #$Hud_Party.visible = false
              #$Hud_Party.active = false
              else
              name = $game_party.actors[0].name
              Network::Main.pchat($party.members[i].netid,"[COM] [ET] #{name}")
              Network::Main.pchat($party.members[i].netid,"[COM] [EXIT] #{name}")
              #Network::Main.pchat($party.members[i].netid,"#{name} foi assassinado e saiu da party!")
              #$Hud_Party.visible = false
              #$Hud_Party.active = false
              end
            end
          end
    =end
           
            $scene = Scene_Gameover.new
          end
          return true
          # Killed
        when /<result_effect>(.*)<\/result_effect>/
          $ABS.netplayer_killed
          return true
        end
        return false
      end
      #--------------------------------------------------------------------------
      # * Update Ingame Parts -> player, 5, 6, 9, 12, 13
      #--------------------------------------------------------------------------
      def self.update_ingame(line)
        case line
        when /<6a>(.*)<\/6a>/
          @send_conf = true
          return true if $1.to_s ==  "'Confirmed'"
        # Chat Recieval
        when /<chat>(.*)<\/chat>/   
          $game_temp.chat_log.push($1.to_s)
          $game_temp.chat_refresh = true
          return true
        # Remove Player ( Disconnected )
        when /<9>(.*)<\/9>/
          # Destroy Netplayer and MapPlayer things
          self.destroy($1.to_i)
          # Redraw Mapplayer Sprites
          $game_temp.spriteset_refresh = true
          $game_temp.spriteset_renew = true
        when /<12>type=(.*) item=(.*) num=(.*) todo=(.*)<\/12>/
          case $1.to_i
          when 0
            $game_party.gain_item($2.to_i, $3.to_i)    if $4 == 'gain'
            $game_party.lose_item($2.to_i, $3.to_i)    if $4 == 'lose'
          when 1
            $game_party.gain_weapon($2.to_i, $3.to_i)  if $4 == 'gain'
            $game_party.lose_weapon($2.to_i, $3.to_i)  if $4 == 'lose'
          when 2
            $game_party.gain_armor($2.to_i, $3.to_i)  if $4 == 'gain'
            $game_party.lose_weapon($2.to_i, $3.to_i)  if $4 == 'lose'
          end
          $game_temp.refresh_itemtrade = true
          return true
        when /<12a>(.*)<\/12a>/
          @trade_conf = true
          return true if $1.to_s == "'Confirmed'"
        # Private Chat Incomming Message
        when /<13 (.*)>(.*)<\/13>/
          got = false
          id = false
          for chat in 0..$game_temp.pchat_log.size
            if $game_temp.lastpchatid[chat].to_i == $1.to_i
              got = true
              id = chat
            end
          end
          if got
            #$game_temp.pchat_log[id].push($2)
            #$game_temp.lastpchatid[id] = $1.to_i
            #$game_temp.pchat_refresh[id] = true
          else
            #id = $game_temp.pchat_log.size
            #$game_temp.pchat_log[id] = []
            #$game_temp.pchat_log[id].push($2)
            #$game_temp.lastpchatid[id] = -1
            #$game_temp.lastpchatid[id] = $1.to_i
            #$game_temp.pchat_refresh[id] = false
            #$game_temp.pchat_refresh[id] = true
          end
          text = $2.to_s.split
          if text[0] == "[COM]"
            if text[1] == "[PT]"
              for p in Network::Main.mapplayers.values
                if p.nome == text[2] and p != nil
                  if $divide_exp != true
                  $convite_party = true
                  $convite.visible = true
                  $convite.active = true
                  $lider_party_nominho = p.nome
                  $lider_party = p
                  $char_idzinho = text[3]
                  $convite.set_text("#{$lider_party_nominho} convidou você para entrar na party, aceitar?",0, -3)
                  end
                end
              end
            elsif text[1] == "[TRADE]"
              if $trade_a != true
            if $item_w.visible != true
            $equip_w.visible = true
            $equip_w.active = true
            $item_w.visible = true
            $item_w.active = true
            $janela_gold_w.visible = true
            end
            #Trade
            for p in Network::Main.mapplayers.values
            if p.nome == text[2]
            $trade_w = Trade_List2.new(p.netid)
            $trade_w_2 = Trade_List3.new(p.netid)
            @trade_w_2_button = Button2.new($trade_w_2,110-50+10-3,85,"Trocar") {Network::Main.pchat($trade_lider_id,"[COM] [TRADE_ACEITAR_TROCA]")}#{$trade_w.trocando_items}
            @trade_w_2_button_2 = Button2.new($trade_w_2,120-3,85,"  Sair  ") {trocando_sair; $convite_trade = false; $fechando_ativar = true}
            $trade_lider_id = p.netid
            $trade_a = true
            $trade_w.closable = true
            $trade_w.dragable = true
            #$trade_w_2.closable = true
            #$trade_w_2.dragable = true
            end
          end
          end
          elsif text[1] == "[TRADE_ACEITAR_TROCA]"
            $convite_trade = true
            $convite.visible = true
            $convite.active = true
            $convite.set_text("Jogador está confirmando a troca, aceitar?",0, -3)
            $convite.refresh
          elsif text[1] == "[TRADE_ADD_ITEM]"
            @item = text[2]
            $trade_w.add(0,@item.to_i)
            $trade_w.refresh
           
            $trade_w_2.refresh
            $janela_gold_w.refresh
            #$item_w.refresh
          elsif text[1] == "[TRADE_ADD_WEAPON]"
            @item = text[2]
            $trade_w.add(1,@item.to_i)
            $trade_w.refresh
           
            $trade_w_2.refresh
          elsif text[1] == "[TRADE_ADD_ARMOR]"
            @item = text[2]
            $trade_w.add(2,@item.to_i)
            $trade_w.refresh
           
            $trade_w_2.refresh
          elsif text[1] == "[TRADE_REM_ITEM]"
            @item = text[2]
            $trade_w.remove2(0,@item.to_i)
           
            $trade_w_2.refresh
            $trade_w.refresh
            $janela_gold_w.refresh
            #$item_w.refresh
          elsif text[1] == "[TRADE_REM_WEAPON]"
            @item = text[2]
            $trade_w.remove2(1,@item.to_i)
           
            $trade_w_2.refresh
            $trade_w.refresh
          elsif text[1] == "[TRADE_REM_ARMOR]"
            @item = text[2]
            $trade_w.remove2(2,@item.to_i)
           
            $trade_w_2.refresh
            $trade_w.refresh
           
           
          elsif text[1] == "[TRADE_REMO_ITEM]"
            @item = text[2]
            @quantidade = text[3]
            $trade_w_2.removeall(3)
            $trade_w_2.index = 0
            $trade_w_2.refresh
            $trade_w.trocando_items
            $trade_w.refresh
          elsif text[1] == "[TRADE_REMO_WEAPON]"
            @item = text[2]
            @quantidade = text[3]
            $trade_w_2.removeall(3)
            $trade_w_2.index = 0
            $trade_w_2.refresh
            $trade_w.trocando_items
            $trade_w.refresh
          elsif text[1] == "[TRADE_REMO_ARMOR]"
            @item = text[2]
            @quantidade = text[3]
            $trade_w_2.removeall(3)
            $trade_w_2.index = 0
            $trade_w_2.refresh
            $trade_w.trocando_items
            $trade_w.refresh
           
           
            elsif text[1] == "[GDD]"
              Guild_Commands.verificar_guild(text[2], text[3], text[4], text[5])
            elsif text[1] == "[GDS]"
              $guild_name = ""
              $game_party.actors[0].guild = ""
              $game_player.refresh
              if User_Edit::GUILD_NAME == true
              $scene = Scene_Map.new
              Network::Main.send_start
              end
              $guild_position = "Membro"
              $guild_lider_name = ""
              $guild_points = 0
              $game_temp.chat_log.push("Você foi expulso da guild!")
            elsif text[1] == "[PNEL]"
              Admin.verificar_comando(text[2], text[3], text[4], text[5])
            elsif text[1] == "[PUXAR]"
              return if text[2] =! $game_party.actors[0].name
              $game_temp.player_new_map_id = text[3].to_i
              $game_temp.player_new_x = text[4].to_i
              $game_temp.player_new_y = text[5].to_i
              $game_temp.player_transferring = true
              #$game_map.setup($game_temp.player_new_map_id)
              #$game_player.moveto($game_temp.player_new_x, $game_temp.player_new_y)
              $game_map.update
              #$scene = Scene_Map.new
              Network::Main.send_start
            elsif text[1] == "[PNEL2]"
              $adm_w_text = text[2..28]
              $adm_w.refresh
              $adm_w.visible = true
            elsif text[1] == "[OK]" 
              $parte_s = true
              $charzinho_id = text[3]
              $party.party_start($charzinho_id)
              $divide_exp = true
            elsif text[1] == "[EXIT]"
              if $parte_s == true
                $party.party_remove($charzinho_id)
              else
                for i in 0..$party.members.size
                $party.party_remove($party.members[i])
                end
              end
              if User_Edit::HUD_PARTY == true
              $Hud_Party.visible = false
              $Hud_Party.active = false
              end
              $divide_exp = false
            elsif text[1] == "[ET]"
              if $parte_s == true
              p = $lider_hud
              if p.nome == text[2] and p != nil
                $party.party_remove(p)
              end
              else
              for i in 0..$party.members.size
                if $party.members[i] != nil
                  p = $party.members[i]
                  if p.nome == text[2] and p != nil
                    $party.party_remove(p)
                    #$divide_exp = false
                  end
                end
              end
              end
            elsif text[1] == "[EX]"
              if $game_map.map_id == text[3].to_i
              @level_actor_agr = $game_party.actors[0].level
              $game_party.actors[0].exp += text[2].to_i
              if $game_party.actors[0].level > @level_actor_agr
              if User_Edit::DISTRIBUIR_ACTIVE == true
              if $game_party.actors[0].level == 99
                else
                  $distribuir_pontos += 5
              end
              end
              if User_Edit::DISTRIBUIR_ACTIVE == true
              if $distribuir_pontos > 0
              if $distribuir_pontos != 0
                  $status.refresh
                  $status.visible = true
              end
              end
              end
              end
              #$ABS.add_to_display('Obtido ' + (text[2].to_i).to_s + ' exp')
              party_exp = (text[2].to_i).to_s
              actor = $game_party.actors[0]
              if User_Edit::VISUAL_EQUIP_ACTIVE == true
              actor = $game_party.actors[0]
              actor.damage = "#{party_exp} Exp"
              else
              $game_player.show_demage("#{party_exp} Exp",false)
              end
              #actor.damage = "#{party_exp} Exp"
              $game_player.animation_id = 101
              #$divide_exp = true
              end
            elsif text[1] == "[GD]"
              if $game_map.map_id == text[3].to_i
              $game_party.gain_gold(text[2].to_i)
              end
            elsif text[1] == "[IN]"
              if $game_party.actors[0].guild == ""
              $convite_guild1 = true
              $convite.visible = true
              $convite.active = true
              $lider_nominho = text[4]
              $guild_nominho = text[2]
              $flag_nominho = text[3]
              $convite.set_text("#{$lider_nominho} convidou você para entrar na guild #{$guild_nominho}",0, -3)
              end
            elsif text[1] == $game_party.actors[0].guild
              $game_party.gain_item(23,1)
            elsif text[1] == "[HF]"
              $game_temp.player_transferring = true
              $game_temp.player_new_map_id = 345
              $game_temp.player_new_x = 7
              $game_temp.player_new_y = 29
              #transfer_player
            elsif text[1] == "[GT]"
              $game_temp.player_transferring = true
              $game_temp.player_new_map_id = 351
              $game_temp.player_new_x = 13
              $game_temp.player_new_y = 27
              #transfer_player
            end
          else
            $ABS.add_to_display($2.to_s)
            $game_temp.chat_log.push($2.to_s)
            $game_temp.chat_refresh = true
          end
          return true
        # Private Chat ID confirmation
        when /<13a>(.*)<\/13a>/
          @pchat_conf = true
          return true if $1.to_s == "'Confirmed'"
        # Private Chat ID confirmation
        when /<21a>(.*)<\/21a>/
          @mchat_conf = true
          return true if $1.to_s == "'Confirmed'"
        #Map Chat Recieval
        when /<21>(.*)<\/21>/     
          $game_temp.chat_log.push($1.to_s)
          $game_temp.chat_refresh = true
          return true
        when /<22a>(.*)<\/22a>/
          if $1 != "Compelete"
            @pm_lines.push("#{$1}")
          elsif $1 == "Compelete"
            update_pms(@pm_lines)
            @pm_lines = []
          end
          return true
        when /<24a>(.*)<\/24a>/
          @trading = true
          return true
        when /<24c>(.*)<\/24c>/
          eval($1)
          $scene = Scene_Trade.new(@trade_id)
          self.trade_add(-1,-1,@trade_id)
          @trade_id = -1
          return true
        when /<24d>(.*)<\/24d>/
          trade_exit = -1
          eval($1)
          #$game_temp.trade_window.dispose
          $game_temp.trade_window = nil
          trade_exit = -1
          return true
        when /<25a>(.*)<\/25a>/
          i_kind = -1
          i_id = -1
          id = -1
          eval($1)
        # p id#$game_temp.items2[id], $game_temp.weapons2[id], $game_temp.armors2[id]
          if i_id < 0 and i_kind < 0
            $game_temp.trade_window.dispose if $game_temp.trade_window != nil
            $game_temp.trade_window = nil
            $game_temp.trade_window = Trade_List.new(id)
            $game_temp.trade_window.refresh
            @trade_compelete = true
            @trading = false
          end
          $game_temp.items2[id] = {} if $game_temp.items2[id] == nil
          $game_temp.weapons2[id] = {} if $game_temp.weapons2[id] == nil
          $game_temp.armors2[id] = {} if $game_temp.armors2[id] == nil
          return if i_id < 0
          case i_kind
          when 0
            if $game_temp.items2[id][i_id] == nil
              $game_temp.items2[id][i_id] = 1
            else
              $game_temp.items2[id][i_id] += 1
            end
          when 1
            if $game_temp.weapons2[id][i_id] == nil
              $game_temp.weapons2[id][i_id] = 1
            else
              $game_temp.weapons2[id][i_id] += 1
            end
          when 2
            if $game_temp.armors2[id][i_id] == nil
              $game_temp.armors2[id][i_id] = 1
            else
              $game_temp.armors2[id][i_id] += 1
            end
          end
          $game_temp.trade_refresh = true
          return true
        when /<25b>(.*)<\/25b>/
          i_kind = -1
          i_id = -1
          id = -1
          eval($1)
          $game_temp.items2[id] = {} if $game_temp.items2[id] == nil
          $game_temp.weapons2[id] = {} if $game_temp.weapons2[id] == nil
          $game_temp.armors2[id] = {} if $game_temp.armors2[id] == nil
          case i_kind
          when 0
            if  $game_temp.items2[id][i_id] > 1
                $game_temp.items2[id][i_id] -= 1
            else
                $game_temp.items2[id].delete(i_id)
            end
          when 1
            if $game_temp.weapons2[id][i_id] > 1
              $game_temp.weapons2[id][i_id] -= 1
            else
              $game_temp.weapons2[id].delete(i_id)
            end
          when 2
            if $game_temp.armors2[id][i_id] > 1
              $game_temp.armors2[id][i_id] -= 1
            else
              $game_temp.armors2[id].delete(i_id)
            end
          end
          $game_temp.trade_refresh = true
          return true
        when /<25d>(.*)<\/25d>/
          $game_temp.trade_accepting = true
          return true
        when /<25e>(.*)<\/25e>/ #Accept
          $game_temp.trade_accepting = false
          $game_temp.start_trade = false
          $game_temp.trade_now = true
          return true
        when /<25f>(.*)<\/25f>/ #Decline
          $game_temp.trade_accepting = false
          $game_temp.start_trade = false
          return true
        end
        return false
      end
      #--------------------------------------------------------------------------
      # * Authenficate <0>
      #--------------------------------------------------------------------------
      def self.authenficate(id,echo)
        if echo == "'e'"
          # If Echo was returned, Authenficated
          @auth = true
          @id = id
          return true
        end 
        return false
      end
      #--------------------------------------------------------------------------
      # * Checks the object range
      #--------------------------------------------------------------------------
      def self.in_range?(object)
        screne_x = $game_map.display_x
        screne_x -= 256
        screne_y = $game_map.display_y
        screne_y -= 256
        screne_width = $game_map.display_x
        screne_width += 2816
        screne_height = $game_map.display_y
        screne_height += 2176
        return false if object.real_x <= screne_x
        return false if object.real_x >= screne_width
        return false if object.real_y <= screne_y
        return false if object.real_y >= screne_height
        return true
      end
    end
    #-------------------------------------------------------------------------------
    # End Class
    #-------------------------------------------------------------------------------
    class Base
      #--------------------------------------------------------------------------
      # * Updates Default Classes
      #--------------------------------------------------------------------------
      def self.update
        # Update Input
        Input.update
        # Update Graphics
        Graphics.update
        # Update Mouse
        $mouse.update
        # Update Main (if Connected)
        Main.update if Main.socket != nil
      end
    end
    #-------------------------------------------------------------------------------
    # End Class
    #-------------------------------------------------------------------------------
    class Test
      attr_accessor :socket
      #--------------------------------------------------------------------------
      # * Returns Testing Status
      #--------------------------------------------------------------------------
      def self.testing
        return true if @testing
        return false
      end
      #--------------------------------------------------------------------------
      # * Tests Connection
      #--------------------------------------------------------------------------
      def self.test_connection(host, port)
        # We are Testing, not Complted the Test
        @testing = true
        @complete = false
        # Start Connection
        @socket = TCPSocket.new(host, port)
        if not @complete
          # If the Test Succeeded (did not encounter errors...)
          self.test_result(false)
          @socket.send("<20>'Test Completed'</20>")
          begin
            # Close Connection
            @socket.close rescue @socket = nil
          end
        end
      end
      #--------------------------------------------------------------------------
      # * Set Test Result
      #--------------------------------------------------------------------------
      def self.test_result(value)
        # Set Result to value, and Complete Test
        @result = value
        @complete = true
      end
      #--------------------------------------------------------------------------
      # * Returns Test Completed Status
      #--------------------------------------------------------------------------
      def self.testcompleted
        return @complete
      end
      #--------------------------------------------------------------------------
      # * Resets Test
      #--------------------------------------------------------------------------
      def self.testreset
        # Reset all Values
        @complete = false
        @socket = nil
        @result = nil
        @testing = false
      end
      #--------------------------------------------------------------------------
      # * Returns Result
      #--------------------------------------------------------------------------
      def self.result
        return @result
      end
    end
    #-------------------------------------------------------------------------------
    # End Class
    #-------------------------------------------------------------------------------
      #--------------------------------------------------------------------------
      # * Module Update
      #--------------------------------------------------------------------------
      def self.update
      end
    end
    #-------------------------------------------------------------------------------
    # End Module
    #-------------------------------------------------------------------------------
    end
    #-------------------------------------------------------------------------------
    # End SDK Enabled Test
    #-------------------------------------------------------------------------------
    Restante...


    _________________
    Alguma Duvida!? Me mande uma MP

    [Resolvido]Erro no sistema de cash BgIconeLivro                 Regras do Fórum


    [Resolvido]Erro no sistema de cash L4thF

    Conteúdo patrocinado


    [Resolvido]Erro no sistema de cash Empty Re: [Resolvido]Erro no sistema de cash

    Mensagem por Conteúdo patrocinado


      Data/hora atual: Dom Nov 24, 2024 6:09 pm