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?
Torque 3D Owner Thomas Bang
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 }