Jump to content

[Outdated][RELEASE] Virtual Garage update for 1061


theduke

Recommended Posts

Just now, Bricktop said:

Thanks for the reply duke -

I looked in the Workbench and I don't see any vehicles stored in the extdb

(I also uploaded the extdb folder to the server root and changed the user/pass) 

============

I use a host for the live server (phpMyAdmin) 

I also have a local server set up here at home for testing (XAMPP/MySQL Workbench)

 

Then its not being stored at all... make sure you allow the user of the database access to the new database you created.

Link to comment
Share on other sites

2 hours ago, theduke said:

I personally think its a good idea that this script removes the key. Like me, I have it so players can transfer vehicles from cherno to taviana.  

Also, it teaches players to make copies of their keys.  If they have a masterkey, they SHOULD have copies...

Yes, except if their toolbelt is full and it drops on the ground and someone else finds it they now have a key to all the vehicles on that key.

Link to comment
Share on other sites

2 hours ago, theduke said:

Then its not being stored at all... make sure you allow the user of the database access to the new database you created.

I guess I'm not sure how to do this part since I was able to run the SQL and create the new db I didn't think I needed permission for anything.

I found this - it's a little old but is this what you're talking about?

 https://www.digitalocean.com/community/tutorials/how-to-create-a-new-user-and-grant-permissions-in-mysql

Link to comment
Share on other sites

1 hour ago, Bricktop said:

I guess I'm not sure how to do this part since I was able to run the SQL and create the new db I didn't think I needed permission for anything.

I found this - it's a little old but is this what you're talking about?

 https://www.digitalocean.com/community/tutorials/how-to-create-a-new-user-and-grant-permissions-in-mysql

in phpmyadmin click on user acounts at the top, then click "Edit privileges" for the user associated.

After you'll see 4 tabs at the top. "Global" "Databases" "change password" "login information"

Click on "databases"

Then bellow you will see a select box. Highlight the extdb database and click on go on the bottom right.

after tha check the "check all" box to select all privileges then click go again.

Done.

See if that works

Link to comment
Share on other sites

Database is fine for me vehicles and gear. Only problem I have is when you store with gear it will not take coins and it says any in vehicle inventory on the garage menu. 

You did edit the the config file for database right? With you username and password. 

Link to comment
Share on other sites

16 hours ago, Bricktop said:

I gave up on this for now ... 

Moving on to something else before I lose my mind lol

I'm going to try to get god mode for vehicles in plot pole working.  (same difference I guess - except for the performance boost) 

If you figure this out please let me know and I'll do the same.

Got it working. I just delted the @extDB folder and pasted it in again. In config i replaced USERNAME and PASSWORD and it worked. Maybe i did a mistake yesterday cause i was rly tired :unsure:

Also make sure the dbname is correct in case u have a different one!

Link to comment
Share on other sites

17 hours ago, theduke said:

in phpmyadmin click on user acounts at the top, then click "Edit privileges" for the user associated.

After you'll see 4 tabs at the top. "Global" "Databases" "change password" "login information"

Click on "databases"

Then bellow you will see a select box. Highlight the extdb database and click on go on the bottom right.

after tha check the "check all" box to select all privileges then click go again.

Done.

See if that works

Much appreciated duke! Details make all the difference.

6 hours ago, SryImAnooB said:

Got it working. I just delted the @extDB folder and pasted it in again. In config i replaced USERNAME and PASSWORD and it worked. Maybe i did a mistake yesterday cause i was rly tired :unsure:

Also make sure the dbname is correct in case u have a different one!

Glad you got this working. I guess I'll put it back up top on the list

So many Ideas and never enough time ...

Link to comment
Share on other sites

14 hours ago, Hooty said:

Database is fine for me vehicles and gear. Only problem I have is when you store with gear it will not take coins and it says any in vehicle inventory on the garage menu. 

You did edit the the config file for database right? With you username and password. 

yeah that never even crossed my mind. Ill fix that with the current  currency variable

Link to comment
Share on other sites

39 minutes ago, salival said:

Maybe time for a github link @theduke

Haha i created one after the first time you mentioned it... Got to be honest i didnt spend time on it to figure it out yet. Been very busy with RL.  One thing i did think about, those scripts arnt mine, i just updated them for 1061.

so i also wouldnt want to offend anyone... but i will certainly get to it soon and add my menu on there

Link to comment
Share on other sites

@Hooty

Alright so the ANY/weapons and not taking your coins is fixed.  

Open your compiles.sqf and add this at the bottom

SC_fnc_removeCoins=
{
	private ["_player","_amount","_wealth","_newwealth", "_result"];
	_player = _this select 0;
	_amount = _this select 1;
	_result = false;
	_wealth = _player getVariable["cashMoney",0];  
	if(_amount > 0)then{
	if (_wealth < _amount) then {
	_result = false;
	} else {                         
	_newwealth = _wealth - _amount;
	_player setVariable["cashMoney",_newwealth, true];
	_player setVariable ["moneychanged",1,true];    
	_result = true;
	PVDZ_plr_Save = [_player,(magazines _player),true,true] ;
	publicVariableServer "PVDZ_plr_Save";            
	};
	}else{
	_result = true;
	};
	_result
};

SC_fnc_addCoins = 
{
	private ["_player","_amount","_wealth","_newwealth", "_result"];			
	_player =  _this select  0;
	_amount =  _this select  1;
	_result = false;	
	_wealth = _player getVariable["cashMoney",0];
	_player setVariable["cashMoney",_wealth + _amount, true];
	PVDZ_plr_Save = [_player,(magazines _player),true,true] ;
	publicVariableServer "PVDZ_plr_Save";
	_player setVariable ["moneychanged",1,true];					
	_newwealth = _player getVariable["cashMoney",0];		
	if (_newwealth >= _wealth) then { _result = true; };			
	_result
};

vehicle_gear_count = {
		private["_counter"];
		_counter = 0;
		{
			_counter = _counter + _x;
		} count _this;
		_counter
	};

OP has been updated with instructions.

I would suggest anyone that has downloaded the files before this post to do the fix also

To Note. The SC_fnc_addCoins block is not needed for this script, but some 1051 scripts use that variable. won't hurt to add it.

Link to comment
Share on other sites

5 hours ago, theduke said:

@Hooty

Alright so the ANY/weapons and not taking your coins is fixed.  

Open your compiles.sqf and add this at the bottom


SC_fnc_removeCoins=
{
	private ["_player","_amount","_wealth","_newwealth", "_result"];
	_player = _this select 0;
	_amount = _this select 1;
	_result = false;
	_wealth = _player getVariable["cashMoney",0];  
	if(_amount > 0)then{
	if (_wealth < _amount) then {
	_result = false;
	} else {                         
	_newwealth = _wealth - _amount;
	_player setVariable["cashMoney",_newwealth, true];
	_player setVariable ["moneychanged",1,true];    
	_result = true;
	PVDZ_plr_Save = [_player,(magazines _player),true,true] ;
	publicVariableServer "PVDZ_plr_Save";            
	};
	}else{
	_result = true;
	};
	_result
};

SC_fnc_addCoins = 
{
	private ["_player","_amount","_wealth","_newwealth", "_result"];			
	_player =  _this select  0;
	_amount =  _this select  1;
	_result = false;	
	_wealth = _player getVariable["cashMoney",0];
	_player setVariable["cashMoney",_wealth + _amount, true];
	PVDZ_plr_Save = [_player,(magazines _player),true,true] ;
	publicVariableServer "PVDZ_plr_Save";
	_player setVariable ["moneychanged",1,true];					
	_newwealth = _player getVariable["cashMoney",0];		
	if (_newwealth >= _wealth) then { _result = true; };			
	_result
};

vehicle_gear_count = {
		private["_counter"];
		_counter = 0;
		{
			_counter = _counter + _x;
		} count _this;
		_counter
	};

OP has been updated with instructions.

I would suggest anyone that has downloaded the files before this post to do the fix also

To Note. The SC_fnc_addCoins block is not needed for this script, but some 1051 scripts use that variable. won't hurt to add it.

Wow I was that close had the SC_fnc_add and remove coins but not the vehicle_gear count.  Thank you!!! Im start banging my head in the desk now lol

Link to comment
Share on other sites

i just added the SC_fnc_removecoins and.. 

Now that i have this in my compiles i wonder... how can i use this in other places.. like the final condition on deploy anything to charge coins for a user to deploy something..

 _condition    | string of code to evaluate to determine whether action is shown     | string | "!(isNull player) && {(getPlayerUID player) in DZE_DEPLOYABLE_ADMINS}"

Thanks for all the release fixes!

Link to comment
Share on other sites

6 hours ago, kingpapawawa said:

i just added the SC_fnc_removecoins and.. 

Now that i have this in my compiles i wonder... how can i use this in other places.. like the final condition on deploy anything to charge coins for a user to deploy something..

 _condition    | string of code to evaluate to determine whether action is shown     | string | "!(isNull player) && {(getPlayerUID player) in DZE_DEPLOYABLE_ADMINS}"

Thanks for all the release fixes!

that would be a question for the scripting forums.

Link to comment
Share on other sites

how hard would it be to charge coins to "store vehicle", tried changing ...

_price = 20000;

but it wont subtract from player ammount

also some errors wich you may or may not know

client.rpt

Spoiler

 

Error in expression <r_manageDoor = -1;

player removeAction s_garage_dialog2;
s_garage_dialog2 = -1;>
  Error position: <s_garage_dialog2;
s_garage_dialog2 = -1;>
  Error Undefined variable in expression: s_garage_dialog2
File mpmissions\__CUR_MP.Chernarus\dayz_code\compile\fn_selfActions.sqf, line 1194

 

server.rpt (when finding position and when storing vehicles with gear for a second or third time) 

Spoiler

 

 4:10:27 Error in expression <dler ["HandleDamage", {false}];
_object setposATL _location;

clearWeaponCargo>
 4:10:27   Error position: <setposATL _location;

clearWeaponCargo>
 4:10:27   Error 2 elements provided, 3 expected
 4:10:27 File z\addons\dayz_server\compile\garage\server_spawnVehicle.sqf, line 100
 4:10:30 Error in expression <agTemp = (_lastMagazines select 0);
if (count _magTemp > 0) then {
_magazines = >
 4:10:30   Error position: <count _magTemp > 0) then {
_magazines = >
 4:10:30   Error count: Type String, expected Array,Config entry
 4:10:30 File z\addons\dayz_server\compile\server_playerSync.sqf, line 70
 

 

 

Link to comment
Share on other sites

1 hour ago, SKS.Goliath said:

If i am ingame how i build as a player a garage   klick tool box?

DOWNLOAD
https://www.dropbox.com/s/ymwq3tm7dfhwjzy/Virtual Garage 1061.zip?dl=0

I use the script a little different than intended.

The only difference, i use vehicle and air traders to access the virtual garage, intended for use with garages, but requires gem crafting...
The original instructions are in the download in case someone wants to do it that way

 

Link to comment
Share on other sites

10 hours ago, Cherdenko said:

wouldn´t it be better if you´d use [Z_MoneyVariable,0]

instead of:


@theduke

i think its necassary for the coins to get removed when storing vehicles etc

see i thought the same thing.  I tried it and it didnt work. maybe thats because i have in my configvariables.sqf

Z_MoneyVariable = "cashMoney"; // If using single currency this is the variable name used to store player wealth.

 

but the variables_ZSC.sqf that came with the single currency also has a 

Z_MoneyVariable

but that one has a different variable.

Z_moneyVariable = "GlobalMoney"

So i think thats why it wasnt working for me.

maybe @salival can clear this up for us

Link to comment
Share on other sites

Just now, theduke said:

see i thought the same thing.  I tried it and it didnt work. maybe thats because i have in my configvariables.sqf

Z_MoneyVariable = "cashMoney"; // If using single currency this is the variable name used to store player wealth.

 

but the variables_ZSC.sqf that came with the single currency also has a 

Z_MoneyVariable

but that one has a different variable.

Z_moneyVariable = "GlobalMoney"

So i think thats why it wasnt working for me.

i think thesc script released by salival is using "worth" as money variable. so i though using Z_moneyVariable has to be used in the garages script

Link to comment
Share on other sites

testing the script a little more seems when it takes money from the player it will corrupt the inventory field in the database

to repoduce

  • store vehicle with gear (make sure it needs money)
  • error will happen with server_playerSync.sqf in server.rpt (dont do anything that uses player_forceSave or you will not see the problem)
  • reboot server when reloging will be stuck in loading screen (errors client.rpt)

might be related to https://github.com/EpochModTeam/DayZ-Epoch/issues/1914

 

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...