Files
AltisLifeFramework/life_hc/MySQL/WantedSystem/fn_wantedBounty.sqf
Benjamin Kyd c8014ec81e initial commit
2019-06-05 00:45:50 +01:00

34 lines
1.1 KiB
Plaintext

/*
File: fn_wantedBounty.sqf
Author: Bryan "Tonic" Boardwine"
Database Persistence By: ColinM
Assistance by: Paronity
Stress Tests by: Midgetgrimm
This file is for Nanou's HeadlessClient.
Description:
Checks if the person is on the bounty list and awards the cop for killing them.
*/
private ["_civ","_cop","_id","_half","_result","_queryResult","_amount"];
_uid = [_this,0,"",[""]] call BIS_fnc_param;
_civ = [_this,1,objNull,[objNull]] call BIS_fnc_param;
_cop = [_this,2,objNull,[objNull]] call BIS_fnc_param;
_half = [_this,3,false,[false]] call BIS_fnc_param;
if (isNull _civ || isNull _cop) exitWith {};
_query = format ["SELECT wantedID, wantedName, wantedCrimes, wantedBounty FROM wanted WHERE active='1' AND wantedID='%1'",_uid];
_queryResult = [_query,2] call HC_fnc_asyncCall;
if !(count _queryResult isEqualTo 0) then
{
_amount = _queryResult select 3;
if !(_amount isEqualTo 0) then {
if (_half) then {
[((_amount) / 2),_amount] remoteExecCall ["life_fnc_bountyReceive",_cop];
} else {
[_amount,_amount] remoteExecCall ["life_fnc_bountyReceive",_cop];
};
};
};