• Just a reminder that providing specifics on, sharing links to, or naming websites where ROMs can be accessed is against the rules. If your post has any of this information it will be removed.
  • Ever thought it'd be cool to have your art, writing, or challenge runs featured on PokéCommunity? Click here for info - we'd love to spotlight your work!
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

[Question] Create a Pokemon Team Logic!! ??

  • 3
    Posts
    11
    Years
    • Seen Apr 28, 2014
    I am trying to make an Online RPG on Pokemon!

    I want to know how can I program to use only 6 pokemons which are selected by the user, to use them in Battle?

    I am using PHP, MySQL!

    Any idea?? :\ :\
     
    I am trying to make an Online RPG on Pokemon!

    I want to know how can I program to use only 6 pokemons which are selected by the user, to use them in Battle?

    I am using PHP, MySQL!

    Any idea?? :\ :\

    Well, you could always check the array's size to see if it contains less than 6 pokemon, and if there is less than 6 pokemon in the party you can safely allow the player to add a new pokemon.

    Here's a VERY simple function to check if you can add a pokemon:
    Code:
    function canAddPokemon($pokemonArray)
    {
        $maxPokemon = 6;
    
        return count($pokemonArray) < $maxPokemon;
    }
     
    Well I tried it! but there were problems which would arise further...!
    But I found a new way by adding a column in database, in users_pokemon! :D

    And it worked :) thnks anyways!
     
    Back
    Top