Jump to content
Sign in to follow this  
Koni

Display amount of units in a group

Recommended Posts

This one I have no idea where to start.

I'd like to be able to display, probably as a hint or something, the amount of units in a certain group.

This group will have units added to it at certain times, but I'd like to be able to show the current amounts on demand.

Any ideas please

Thanks

Share this post


Link to post
Share on other sites

Try this:

// display number of units in a group
// groupleaders init: groupname = group this; groupname setGroupID ["whatever"];
// nul=[groupname] execVM "groupcount.sqf";

if !(isServer) exitWith {};

private ["_grp","_number"];

_grp = _this select 0;

_number = (count units _grp);
hint format["There are %1 units in group %2", _number, _grp];

Edited by Wiggum

Share this post


Link to post
Share on other sites

Thanks Wiggum, chopped it a little and made what I wanted it to do now :)

if !(isServer) exitWith {};

private ["_grp","_number"];

_grp = _this select 0;

_number = (count units _grp);
hint format["You have %1 Hens", _number, _grp];

---------- Post added at 01:49 PM ---------- Previous post was at 01:48 PM ----------

Just the number? Or the name, type or something else?

Yeah it was just for the amount in the group :)

Share this post


Link to post
Share on other sites

if !(isServer) exitWith {};

private ["_grp","_number"];

_grp = _this select 0;

_number = (count units _grp);
hint format["You have %1 [size="3"][b][color="Red"]Hens[/color][/b][/size]", _number, _grp];

:suspect:

Hens ???

Anyway, you only need this now:

hint format["You have %1 Hens", _number];

Share this post


Link to post
Share on other sites

Yes Hens :p

Basically it's a campaign I'm making, where as a young Takistan, you're pressed into working as an Agent for a UK Organisation. You have to play the part of a peasent farmer inbetween doing missions, a little like Hitman, doing assasinations etc, but the Curency in the game is Hens, the more you collect you can then hire your own men to aid you in your assignments :)

The Hens you collect join a group based at your Farm house, so I wanted something to show how many Hens you have so you know how many more you need to find before you can hire another Thug\man etc.

Edited by Koni

Share this post


Link to post
Share on other sites

Are you working on exploding killer hens or what ?

Would be cool to give a hen a move command and it would explode near the enemy... :yay:

Share this post


Link to post
Share on other sites

Ha, would be cool, but those damn animals don't respond to any form of orders :(

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×