Jump to content
hoverguy

[Release] Simple Weapon Shop System

Recommended Posts

Currently using your shop in a PMC setting. 
Is there a way to add crates to the shop, where you can store all of your things you have bought? 
The crates need to be store in database, i case of server restart too.

  • Like 1

Share this post


Link to post
Share on other sites

Hello Hoverboy

 

Amazing work and thank you very much for the script. Just a quick question.

HG_vehicleAliveUpdate doesn't seem to get used anywhere in the shop system. So if you take a vehicle out of your garage and it gets destroyed, after then next server restart you have the same vehicle again in your garage? Like you never lost it.

I tried to implement it somehow but I'am kind of stuck. Maybe you could help me out.

 

Thanks in advance for your time!

  • Like 1

Share this post


Link to post
Share on other sites

Thanks for the help though I have one more question. Would it be possible to change the type of currency and if so where would I place the classname for example I am using the Ravage Mod and that has its own currency type. "rvg_money"

 

Is it some kind of variable? If so open HG\Config\HG_Config.h and set cashVariable to "rvg_money", if it's an item you will have to modify some files...  

What files to change to work with physical money "rvg_money"

  • Like 1

Share this post


Link to post
Share on other sites
On 5/2/2016 at 9:11 AM, hoverguy said:

You're welcome, I have a similar system in my own mission where money is an inventory item (physical), you can drop/gather/loot it, buy stuff etc...

 

Hello Hoverguy! I am loving and using all your shops for all my missions but I've a couple questions...

 

1) You said you have a system where money is also an inventory item. Is there a way for me to drop money on the ground as a physical item and that item represents XXX amount of money? So perhaps it can be dropped when players die?

 

2) Is there a way to limit the stock available of certain/all items on the shops what get increased after time/ when players sell items?

 

3) What does your persistence system saves? Because it doesn't seem to save player health and when a players leaves and rejoins my server they get full health again so that way if they where close to death they cheat death! =(

 

Thanks in advance!

 

PS: Perhaps a system like antistasi where if enough players sell an item it becomes infinite on the shop would be awesome to have as an option!

Share this post


Link to post
Share on other sites

I use EOS in my mission, after the capture, I couldn’t sell the bots technique or put them in the garage. How to fix it? I wanted to do so but failed.
/ *
     If the function is used locally (e.g using addAction ...)
     (_this select 0) refers to the vehicle
* /
[(_this select 0)] call HG_fnc_setOwner;

/ *
     Else ... remote execution
     _unit refers to the new vehicle owner
* /
[_vehicle, _unit] remoteExecCall ["HG_fnc_setOwner", _ unit, false];

Share this post


Link to post
Share on other sites
On 29/12/2017 at 12:38 PM, hoverguy said:

Hello @bl2ck dog

 

Thank you! Make sure you have all the required stuff in initPlayerLocal.sqf, have you tried the provided mission in editor? Is it working?

 

 

I was having A bit of an issue with vehicles so i tried it on the provided mission and still have an issue where I can see inventory or empty vehicle but I can not enter the vehicle.
Made a video of me unpacking. then editing the suv price to $100 so I can buy one then load up arma and run the mission. 

Spoiler

 

Let me know if i'm doing something stupid please.
I've got this running in a single player and everything else seems to work spot on. 

Share this post


Link to post
Share on other sites
24 minutes ago, Monosyllabicben said:

I was having A bit of an issue with vehicles so i tried it on the provided mission and still have an issue where I can see inventory or empty vehicle but I can not enter the vehicle.
Made a video of me unpacking. then editing the suv price to $100 so I can buy one then load up arma and run the mission. 

  Reveal hidden contents

 

Let me know if i'm doing something stupid please.
I've got this running in a single player and everything else seems to work spot on. 

Out of curiosity do you have the kill rewards working?? And the ranking system in SP? Im trying to get it to work but nothing I tried has been of any use to me.. Any help would be appreciated thanks!

Share this post


Link to post
Share on other sites
20 hours ago, socs said:

Out of curiosity do you have the kill rewards working?? And the ranking system in SP? Im trying to get it to work but nothing I tried has been of any use to me.. Any help would be appreciated thanks!

I run this along with the ravage mod and get $ and xp for killing zombies.
 

Spoiler

in the KilledEvent Handler section of the Ambient Zombie module i have 
[10,0] call HG_fnc_addOrSubCash; [10,0] call HG_fnc_addOrSubXP;
add 10 $ per kill and 10 xp

 

  • Like 1

Share this post


Link to post
Share on other sites
16 minutes ago, Monosyllabicben said:

I run this along with the ravage mod and get $ and xp for killing zombies.
 

  Hide contents

in the KilledEvent Handler section of the Ambient Zombie module i have 
[10,0] call HG_fnc_addOrSubCash; [10,0] call HG_fnc_addOrSubXP;
add 10 $ per kill and 10 xp

 

Actually figured this out last night but thank you.. I use a different script made by a friend of mine and it works hand in hand with the XP system HG already has in place so, the amount of cash and XP you get depends on your rank etc... 
 

Spoiler

//________________  Author : GEORGE FLOROS [GR] ___________ 11.01.19 _____________

/*
________________ GF_HG_fnc_aiUnitSetup Script - Mod ________________



Please keep the Credits or add them to your Diary

https://community.bistudio.com/wiki/SQF_syntax
Don't try to open this with the simple notepad.
For everything that is with comment  //  in front  or between /*
means that it is disabled , so there is no need to delete the extra lines.

You can open this ex:
with notepad++
https://notepad-plus-plus.org/

and also use the extra pluggins
(this way will be better , it will give also some certain colors to be able to detect ex. problems )
http://www.armaholic.com/page.php?id=8680

or use any other program for editing .

For the Compilation List of my GF Script - Mods , you can search in:
https://forums.bohemia.net/forums/topic/215850-compilation-list-of-my-gf-Script - Mods/
*/


//________________	You can add in the init of a unit to exclude 	________________	
//	this setVariable ["Var_GF_HG_fnc_aiUnitSetup", true];


//________________ Settings ________________
//________________ Set true or false  ________________


_Systemchat_info								= true;
_diag_log_info									= true;	

GF_HG_fnc_aiUnitSetup_to_Certain_Classnames		= true;	
GF_HG_fnc_aiUnitSetup_on_Respawn	= true;	


if(_Systemchat_info) then {
systemchat "GF_HG_fnc_aiUnitSetup Script - Mod Initializing";
};

if(_diag_log_info) then {
diag_log "//________________	GF_HG_fnc_aiUnitSetup Script - Mod Initializing	_____________";
diag_log "//________________	GF_HG_fnc_aiUnitSetup.sqf	_____________";
};




//________________ You can add an Exclude List  ________________

GF_HG_fnc_aiUnitSetup_Exclude_List = [
	//	Ravage zombies

]; 
	


//________________ Certain Classnames option ________________

//________________ add the Classnames , that will change the loadout for the Certain Classnames option ________________

GF_HG_fnc_aiUnitSetup_Riflemen = [
	"B_Soldier_F",
	"B_Soldier_lite_F"
];

//________________ add the Classnames , that will change the loadout for the Certain Classnames option ________________

GF_HG_fnc_aiUnitSetup_Sniper = [
	"B_sniper_F",
	"B_spotter_F"
];




GF_HG_fnc_aiUnitSetup = {
	

//________________	GF_HG_fnc_aiUnitSetup_to_Certain_Classnames	________________	
//________________	check your directory	________________

if(GF_HG_fnc_aiUnitSetup_to_Certain_Classnames) then {


//________________	add here your case	________________

//	Rifleman
if(typeof _this in GF_HG_fnc_aiUnitSetup_Riflemen) then {[_this]call HG_fnc_aiUnitSetup;};

//	Sniper
if(typeof _this in GF_HG_fnc_aiUnitSetup_Sniper) then {[_this]call HG_fnc_aiUnitSetup;};


//	if + allunits, uncomment below :

if(
	//________________	add here your cases	________________
	
	(!(typeof _this in GF_HG_fnc_aiUnitSetup_Riflemen))
	&& (!(typeof _this in GF_HG_fnc_aiUnitSetup_Sniper))
	
	) then {
	[_this]call HG_fnc_aiUnitSetup;
	};

	} else {

//________________	allunits	________________
	
	[_this]call HG_fnc_aiUnitSetup;
};


//________________	Change_Loadout_on_Respawn	________________	

if (GF_HG_fnc_aiUnitSetup_on_Respawn) then {

_this addEventHandler ["Respawn", {
	params ["_unit", "_corpse"];
	_unit setVariable ["Var_GF_HG_fnc_aiUnitSetup",false];
}];
};

};


[] spawn {
	while {true} do {		
		{		
		if (
		((alive _x)) 
		&& (!(_x getVariable ["Var_GF_HG_fnc_aiUnitSetup",false])) 
		&& (!((typeOf _x) in GF_HG_fnc_aiUnitSetup_Exclude_List)) 
		
		/*
		//________________	You can filter the side here	________________	
		&& {((side group _x) isEqualto west || 
			(side group _x) isEqualto east || 
			(side group _x) isEqualto independent || 
			(side group _x) isEqualto civilian)}
		*/
		
		//	&& (side group _x isEqualto playerSide)
		//	&& (!(side group _x isEqualto playerSide))
		
		) then {
			
			_x spawn GF_HG_fnc_aiUnitSetup;
			
			};						
			_x setVariable ["Var_GF_HG_fnc_aiUnitSetup",true];
			{waitUntil {!alive _x};
			_x setVariable ["Var_GF_HG_fnc_aiUnitSetup",false];		 
			};
		}forEach allUnits;
		sleep 5;
	};
};		


if(_Systemchat_info) then {
systemchat "GF_HG_fnc_aiUnitSetup Script - Mod Initialized";
};

if(_diag_log_info) then {
diag_log "//________________	GF_HG_fnc_aiUnitSetup Script - Mod Initialized	_____________";
};

 

 

Share this post


Link to post
Share on other sites
5 minutes ago, socs said:

I use a different script made by a friend of mine and it works hand in hand with the XP system HG already has in place so, the amount of cash and XP you get depends on your rank etc... 

 

Hello there socs !

 

I think it would be very good to share this with everyone !

The progress for all kind of things , is always based on sharing the Knowledge !

Share this post


Link to post
Share on other sites
1 minute ago, GEORGE FLOROS GR said:

 

Hello there socs !

 

I think it would be very good to share this with everyone !

The progress for all kind of things , is always based on sharing the Knowledge !

Sure thing! I shall update my response with the code.

  • Like 1

Share this post


Link to post
Share on other sites
13 minutes ago, socs said:

//________________ Change_Loadout_on_Respawn ________________

 

The original code  is :

 

 

So there you can find some extended examples .

 

By the way it's good to edit this a bit , Loadout !

 

That should be like :

//________________   spawn function on respawn  ________________

 

Thanks !

  • Like 1

Share this post


Link to post
Share on other sites
1 hour ago, GEORGE FLOROS GR said:

 

The original code  is :

 

 

So there you can find some extended examples .

 

By the way it's good to edit this a bit , Loadout !

 

That should be like :


//________________   spawn function on respawn  ________________

 

Thanks !

No no, what I was trying to say was, when I kill certain CSAT units, they count as kills... However, when I kill Independent/ or just regular ravage zombies, I don't get the money or XP as I would when killing lets say an "ammo bearer" csat unit... If you could tell me where I can add maybe more classnames to the kill reward list or have it to where killing any unit (aside from any friendly factions) gives you money and XP... Thank you!

  • Like 1

Share this post


Link to post
Share on other sites

HI, Wonder if anyone can help me?

(I've only just started trying to this a week ago so my knowledge of scripts is really limited) 
I am running ravage mod with this as well and also have areas where higher end vehicles spawn.

I currently have a basic script running 

Spoiler

{
   _x addAction ["Hot Wire", {(_this select 0) call HG_fnc_setOwner;}];
} forEach vehicles;

So it allows me to take ownership of vehicles that have spawned in through ravage or any other means but it also means I can take ownership of other players vehicles. 

I tried to make something that would check for ownership but just couldn't figure out how to get it to work. 

if anyone has the time to help its appreciated.

Share this post


Link to post
Share on other sites
33 minutes ago, Monosyllabicben said:

if anyone has the time to help its appreciated.

 

Hello there Monosyllabicben !

 

First of all , just to inform you that , i haven't yet seen try and test the Simple Weapon Shop System ,

 

as i noticed @hoverguy 's last time hogged is january 25 , so he is active and he the best guy probably to ask , since it's his creation.

Generally speaking on scripting then ,

there are ways to succed this but you should wait fo HG's reply , because , what you are looking for , might be there already .

 

So since you are a Ravage player , for you and for everyone else :

 

 

Be part of it , group with other members , read our Topics !

 

Thanks !

Share this post


Link to post
Share on other sites

Can anyone help me with where to put this function to get it to work. I am working on a PMC mission where we can steal enemy vehicles and sell them or store them.

/*

If the function is used locally (e.g using addAction...)

(_this select 0) refers to the vehicle */

[(_this select 0)] call HG_fnc_setOwner;

 

/* Else... remote execution

_unit refers to the new vehicle owner

*/

[_vehicle,_unit] remoteExecCall ["HG_fnc_setOwner",_unit,false];

Where do I put this script at, the github does not explain it well at all. I put in the init.sqf, initPlayerLocal, iniPlayerServer, initServer. Nothing, not working at all, except when I put it in the initPlayerLocal, it shows the message at the top right, Now owner of () or Now owner of (Rifleman). The enemy are being spawned in by a dynamic AI script, would that be a problem? Do the vehicles have to be pre-spawned in?

Thank you for any help.

 

DISREGARD, FIXED IT.

Edited by Drifter
Fixed

Share this post


Link to post
Share on other sites

Hello @Drifter

 

The place where you put the functions provided in the wiki varies a lot... I cannot cover all the possibilities... sorry for that. You need the basic coding knowledge to figure out, you can open the file and see how it works so you get a better understanding.

 

Thanks for using my shops.

  • Like 2

Share this post


Link to post
Share on other sites

I'm a noob, and didn't see something covered yet. How does one disable the ever present option to open the buy menu so that proximity to objects/entities is the only way to buy?

Share this post


Link to post
Share on other sites

Hey Hover it seems that your sql script must be outdated i keep getting an error saying "/* SQL Error (1064): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 */
/* Affected rows: 0  Found rows: 0  Warnings: 0  Duration for 6 of 15 queries: 0.016 sec. */" any ideas on how to fix this ive looked and i cannot find a thing wrong with it ive compared it and ive found nothing thanks for your time to read this 

Share this post


Link to post
Share on other sites
3 hours ago, T.Johnson said:

Hey Hover it seems that your sql script must be outdated i keep getting an error saying "/* SQL Error (1064): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 */
/* Affected rows: 0  Found rows: 0  Warnings: 0  Duration for 6 of 15 queries: 0.016 sec. */" any ideas on how to fix this ive looked and i cannot find a thing wrong with it ive compared it and ive found nothing thanks for your time to read this 

 

Hello @T.Johnson

 

Replace

CREATE DATABASE IF NOT EXISTS `HG` DEFAULT CHARACTER SET utf8mb4 COLLATE;

with 

CREATE DATABASE IF NOT EXISTS `HG` DEFAULT CHARACTER SET utf8mb4;

 

  • Like 1

Share this post


Link to post
Share on other sites

When viewing in the store of car from Arma 3 Creator DLC: Global Mobilization - Cold War Germany often there is a departure from the game to the desktop

Share this post


Link to post
Share on other sites

Hello, 

 

Thank you for the awesome work, this is exactly what I was looking for!

I have scanned all 10 pages of this thread, but have not found an answer. Forgive me if I missed it.

How do I reset the stats? I have racked up lots in testing the mission,  but want to start fresh now.

Please help! Thanks.

  • Like 1

Share this post


Link to post
Share on other sites

Hello @C.Hall

 

I presume that you're using profile namespace as saving method and that the mission is not hosted in that case this code will reset saved stats for you:

uid = getPlayerUID player;
["HG_Cash","HG_Bank","HG_XP","HG_Kills","HG_Gear","HG_Garage"] apply {profileNamespace setVariable [format["%1_%2",_x,uid],nil]; saveProfileNamespace;};

Load up the editor, open the debug console and copy/paste this code then exec local.

Share this post


Link to post
Share on other sites

You have assumed all correctly and thank you for your fast response.

Thank you for the solution, and keep up the great work!

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

×