Jump to content
Sign in to follow this  
Gameadd1cted

Check if object is person or vehicle

Recommended Posts

Hi,

I am working on a script trying to count the civilian deaths (victims by WEST, EAST, other). It works, nevertheless victims killed by a vehicle are not counted for a specific side.

if (side _killer == west) then
{
	civilian_killed_by_west = civilian_killed_by_west + 1;
	publicVariable "civilian_killed_by_west";
};

This is probably very obvious, but how an I check if the returned object from an event handler is a vehicle or a man?

I tried

if (vehicle _killer != _killer) then {hint "Veh"} else {hint "Infantery kill"}

I try to get to side of the commander or the gunner of the killing vehicle.

Thanks.

Share this post


Link to post
Share on other sites

if (_killer isKindOf "Man") then {hint "Man"} else {hint "Veh"};

Untested but should work.

Share this post


Link to post
Share on other sites
Hi,

I try to get to side of the commander or the gunner of the killing vehicle.

Thanks.

try:

if ( (side (group (driver (vehicle _killer)))) == west ) then {hint "its a west operated vehicle"};

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  

×