Jump to content

Recommended Posts

I was wondering if there is any way to require data from .json files inside q .sqf file. Or anything that covers that functionallity.

 

The thing is: when a player buy a new custom loadout on the website, a post request is made with his ID to a file. Then, the if statemant checks the json file to watch for the player ID instead to watch for it on the array.

the execVM function can do this? there is other way? 

 

Thank you all.

//Default way for doing this

if ((getPlayerUID player) in ["456789123"]) then {  //Donators: Nobody
	DefaultMagazines = [{custom_items}];
	DefaultWeapons = [{custom_items}];
	DefaultBackpack = "{custom_item}";
	DefaultBackpackWeapon = "{custom_item}";
	};

//Exepected way
loadout.sqf

if ((getPlayerUID player) in {file.json} ) then {  //Donators: Nobody
	DefaultMagazines = [{custom_items}];
	DefaultWeapons = [{custom_items}];
	DefaultBackpack = "{custom_item}";
	DefaultBackpackWeapon = "{custom_item}";
	};

//JSON with the buyers ID's
file.json

{[
	'123456789','987654321', '159753468',.....
]}

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

×