Game Development Community

Message on client

by Danny William Yonas · in Torque 3D Beginner · 04/19/2010 (7:01 pm) · 2 replies

I try to make a multiplayer games, and i want to put a message on the client, showing the client ammo or health. What's the code, and where i should put it?

About the author

Recent Threads

  • Spawn AI

  • #1
    04/20/2010 (6:43 am)
    Look for commandToClient and commandToServer.

    Your server has a SimGroup called clientGroup. In this SimGroup you will find all id's of the connected clients.

    Example:

    %numClients = clientGroup.getCount();
    for (%i=0;%i<%numClients; %i++)
    {
       %client = clientGroup.getObject(%i);
       commandToClient(%client, 'displayTheHealth',%client.health);
    }
    Note: %client.health is only an example.

    On the client-side you need the "displayTheHealth"-function.

    function clientCmddisplayTheHealth(%theHealth)
    {
       // do something with the value
    }
    #2
    05/10/2010 (8:16 pm)
    thanks.. it goes well