Jump to content
Sign in to follow this  
kiptanoi

AddRating and get players profile name.

Recommended Posts

Is there anyway to addRating by 200 to the player who kills one enemy?

How to?

And is there anyway to make one sideChat or hint with this text:

Player <The players profile name> got 200 points for killing a enemy.

How to?

Hope you understand what I am looking for here =)

Share this post


Link to post
Share on other sites

Many target types already give a player 200 points. Check this out:

http://community.bistudio.com/wiki/ArmA:_Rating_Values

You can modify it with addRating http://community.bistudio.com/wiki/addRating, giving it either a positive or negative value. Here is a rudimentary event handler script that will provide a chat notification if an enemy is killed, and by whom. However I did not check to see if the killer is a player, but hopefully this will help you get started.

{
if (side _x == east) then 
{
	_x addEventHandler ["killed", {
		player sideChat format["Player %1 got 200 points for killing an enemy.",_this select 1];
	}];
};
} forEach allUnits;

Share this post


Link to post
Share on other sites

Oh thanks =)

But this "%1" thing in the sideChat is the name I have in the editor.

Can i get the name of the player profile he or she is using in Arma 2?

Share this post


Link to post
Share on other sites
Oh thanks =)

But this "%1" thing in the sideChat is the name I have in the editor.

Can i get the name of the player profile he or she is using in Arma 2?

[west,"HQ"] sideChat format["Player %1 got 200 points for killing an enemy.",name player];

or

[west,"HQ"] sideChat format["Player %1 got 200 points for killing an enemy.",typeof player];

Edited by cobra4v320

Share this post


Link to post
Share on other sites
[west,"HQ"] sideChat format["Player %1 got 200 points for killing an enemy.",name player];

or

[west,"HQ"] sideChat format["Player %1 got 200 points for killing an enemy.",typeof player];

I can also put it on Arma 3? I have to insert it into 'init? thanks

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  

×