Jump to content
Sign in to follow this  

Adding a payout script to hideouts using the Alliance Apps gang capture/update functions

Recommended Posts

I have ti where everything captures, it all saves to the database so hideouts save the gang that owns them, I am trying to pull the value of the hideout owner from the gang_info table and then edit the bank data of the gang matching the ID. I am wondering if this:

filename: fn_paygangs.sqf

_hideoutclassnames = getArray(missionConfigFile >> "gang_config" >> "hideouts" >> "possible_hideout_classes"); //you'd rather use terrainsort, but this function is not present in AL 4.0
_query = "SELECT value FROM gangs WHERE id in ('hideout1','hideout2','hideout3')";
_queryResult = [_query,2,true] call DB_fnc_asyncCall;
for '_i' from 1 to 3 do {
	_pos = getArray(missionConfigFile >> "gang_config" >> "hideouts" >> worldname >> format["gang_hideout%1_pos",_i]);
    _gh = (nearestObjects[_pos,_hideoutclassnames,5]) select 0;
    _val = (_queryResult select (_i - 1)) select 2;
	_owner = format["SELECT id FROM gangs WHERE id='%1' AND active='1'",_val];
	_gFund = _owner getVariable ["gang_bank",0];
	_owner setVariable ["gang_bank",round(_gFund+((count playableUnits)*2000)),true];
	[3,_owner] remoteExecCall ["TON_fnc_gang_update",2];
sleep 600;
[] spawn TON_fnc_paygangs;

is a way to pay out the gangs that own the hideouts based on the playercount on the server. I am just trying to see what options I have.

Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Create New...

Important Information

By using this site, you agree to our Terms of Use.