How to make a fight in an online game and then throw it to any player online? For this, everything is of type hp, attack, etc.

    1 answer 1

    Very simple. A link is thrown into the chat, for example:

    <a href='/?unitId=27845&enemyId=111999'>Вызываю на бой!!!</a> 

    // php:

     if(!empty($_GET['unitId'])){ if($_GET['unitId']!=$_GET['enemyId']){ fight($_GET['enemyId'],$_GET['unitId']);// Функция боя. Применяет attack и hurt методы, пока у кого-то hp не станут отрицательными. } } 
    • oh thank you =) - k0mar