Jump to content
Eroge

Command "vehicle" only return the unit's name

Recommended Posts

I add some info in this kill info code, but no matter where the killer is, the vehicle command will only return he's group number, Why???

KAI_fnc_killedInfo = {
_victimName = name (_this select 0);
_killerName = name (_this select 1);
_weaponName = getText (configFile >> "cfgWeapons" >> currentWeapon (_this select 1) >> "displayname");
_distance = (_this select 0) distance (_this select 1);
_vehicle = vehicle (_this select 1);
systemChat format ["%1 被(was killed by) %2 杀死 | 使用武器(killer's weapon):%3 | 击杀距离(distance):%4米(m)", _victimName, _killerName, _weaponName, _distance];
systemChat format ["%1 驾驶载具(killer's vehicle) %2", _killerName, _vehicle];
};

{
   _id = _x addMPEventHandler ["MPKilled", {
	_nul = _this call KAI_fnc_killedInfo;
   }];
} foreach allUnits; 

The result:

 

54255365_665539293864361_205070882211627

 

Should I use objectParent instead?

Share this post


Link to post
Share on other sites
1 minute ago, pierremgi said:

typeOf _vehicle

What do you want exactly?

 

 

Just want to show the killer's vehicle

Share this post


Link to post
Share on other sites

The thread title is:

Quote

Command "vehicle" only return the unit's name

Which suggests you only want to get the units name, which is already used in your snippet.

 

The issue you mention in the first post is:

Quote

the vehicle command will only return he's group number

 

Then when being asked what you want you respond with:

13 minutes ago, Eroge said:

Just want to show the killer's vehicle

 

:yay:

 

Not really sure what you want, can you rephrase it?

Do you mean the class name of the killers vehicle?

Or the displayName?

 

Cheers

 

Share this post


Link to post
Share on other sites

getText (configFile >> "cfgVehicles" >> typeOf vehicle (_this select 1) >> "displayname")

Share this post


Link to post
Share on other sites
3 minutes ago, Grumpy Old Man said:

The thread title is:

Which suggests you only want to get the units name, which is already used in your snippet.

 

The issue you mention in the first post is:

 

Then when being asked what you want you respond with:

 

:yay:

 

Not really sure what you want, can you rephrase it?

Do you mean the class name of the killers vehicle?

Or the displayName?

 

Cheers

 

 

 

Sorry for that confusing description... and yes I want the class name of the vehicle

Share this post


Link to post
Share on other sites
3 minutes ago, Eroge said:

Sorry for that confusing description... and yes I want the class name of the vehicle

Then the first post by @pierremgi is your solution.

 

Cheers

Share this post


Link to post
Share on other sites
1 minute ago, Grumpy Old Man said:

Then the first post by @pierremgi is your solution.

 

Cheers

 

27 minutes ago, pierremgi said:

typeOf _vehicle

What do you want exactly?

 

 

Got it. Thanks a lot

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

×