Jump to content
OpFern

I need help with scripting

Recommended Posts

So I have succesfully made an money system in my game. but I want to add a way to get money without admin or host executing an debug console command to add money, so I thought that maybe if you kill the enemy team you get money for each kill ai or player but I have tried everything and I have googled, binged, yahood you name it and I cant find an working script or something to lead me in the right way NOTHING. so I am hoping that YOU can help me ;). 

 

thx in advance OpFern

Share this post


Link to post
Share on other sites

I appreciate your help, but I have tried all of the links that come up when you search anything near what you searched. 

Share this post


Link to post
Share on other sites

I am trying to make a system so for every ai or player kill you get you earn money. initServer.sqf:

Quote

{ _x addMPEventHandler ["mpkilled", {(_this select 2) execVM "scripts\moneysys\killed.sqf"}]; }forEach playableUnits - allPlayers;

initPlayerLocal.sqf:

Quote

player addMPEventHandler ["MPkilled", {(_this select 2) execVM "scripts\moneysys\killed.sqf"}];

killed.sqf:

Quote

params ["_killer"]; if (_killer in allPlayers) then { [[[(_this select 2)],"scripts\moneysys\asfdasadsf.sqf"],"BIS_fnc_execVM", _killer, false, true] call BIS_fnc_MP; }

addMoney.sqf:

Quote

cash=cash+100;
(uiNameSpace getVariable "myUI_DollarTitle") ctrlSetText format ["Money: %1",cash];
cutText "Kill +100$";

 

Share this post


Link to post
Share on other sites
1 hour ago, OpFern said:

I appreciate your help, but I have tried all of the links that come up when you search anything near what you searched. 


Just out of curiousity, did you get the same results?

fJzVSOF.jpg

Share this post


Link to post
Share on other sites

I found the link, thanks I will have a look here seems like there is alot of nice stuff :)

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

×