Jump to content
  • 0

Humanity or coin gain message by player kill


Airwaves Man

Question

Hey guys,

I'm totally out of ideas. When a player shoots another player then he gets humanity or coins at my server. But how can I display that for the player who gets the humanity or coins? A normal systemchat message or a title text is enough for me but I cannot get it to work. The problem is, that the gain message is displayed at the guy who got shoot not at the one who shot. Can someone help me out?

Link to comment
Share on other sites

8 answers to this question

Recommended Posts

  • 1
15 minutes ago, A Man said:

Dude, I know how to give the player coins after a kill. Thats not what I asked for. The problem is a message that is displayed at player a when player a shoots player b and get coins for it. I asked the same question in the topic you linked.

Just a quick one, not tested at all:

If you utilize the player_death from OMC's thread above:

		//Player kill rewards
		_killer = _realSource;
		_coins = _killer getVariable [Z_moneyVariable,0];
		_coins = _coins + 250;
		_killer setVariable[Z_moneyVariable,_coins,true];

and you use my ZSC, you can send a private message to a specific player by their UID:

https://github.com/oiad/ZSC/blob/master/dayz_server/compile/server_handleSafeGear.sqf#L122-L123

Add the example below after this line:

_killer setVariable[Z_moneyVariable,_coins,true];

example:

RemoteMessage = ["private",[getPlayerUID _killer,format ["You killed %1, he had %2 %3.",_name,[_coins] call BIS_fnc_numberText,CurrencyName]]];
publicVariable "RemoteMessage";

 

Link to comment
Share on other sites

  • 0
2 minutes ago, A Man said:

Thx @salival Im not using any of the scripts you mentioned but thx for showing the way how it could work. I will test it.

All you would need is a publicEventHandler on every client to monitor for a message

Or just run my remote_messages script from here: https://github.com/oiad/ZSC/blob/master/dayz_code/compile/remote_message.sqf

in your init.sqf here: https://github.com/oiad/ZSC/blob/master/init.sqf#L141

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
  • Discord

×
×
  • Create New...