Jump to content

creativv

Member
  • Posts

    191
  • Joined

  • Last visited

  • Days Won

    3

Posts posted by creativv

  1. Just now, creativv said:

    Dont just copy stuff over but try to understand it a little bit , there is a great video made by Raymix that actually helpen me so much to understand allot .

    Believe me i am far from being a dev or a supermodder but i do try to understand the concepts instead of trying to copy it over without even understanding and believe me you will need that simply because not

    every script will cooperate with eachother and you will need to have at least a bit of understanding .

    If you ever need some help i am Always willing to help a bit .

    Sorry moderators for spamming a bit in posts :D

    https://www.youtube.com/watch?v=cN9ob9FPUHY     the video by raymix its a bit long but really good

     

  2. Dont just copy stuff over but try to understand it a little bit , there is a great video made by Raymix that actually helpen me so much to understand allot .

    Believe me i am far from being a dev or a supermodder but i do try to understand the concepts instead of trying to copy it over without even understanding and believe me you will need that simply because not

    every script will cooperate with eachother and you will need to have at least a bit of understanding .

    If you ever need some help i am Always willing to help a bit .

  3. I did the same thing in the giveplayeramount ill show you .

     

    GivePlayerAmount = {
    private ["_amount","_target","_wealth"];
    _amount = parseNumber (_this select 0);
    _target = cursorTarget;
    _wealth = player getVariable["cashMoney",0];
    _twealth = _target getVariable["cashMoney",0];
    _InTrd = _target getVariable ["TrBsy",false];
    _isMan = _target isKindOf "Man";
    if (_amount < 1 or _amount > _wealth) exitWith {
    cutText ["You can not give more than you currently have.", "PLAIN DOWN"];
    };
    if (LimitOnPlayer && ((_twealth + _amount ) >  MaxPlayerCoins )) exitWith {  //This is what i added 
    		cutText ["Player has to many coins you can only carry 950,000", "PLAIN DOWN"];
    };
    if (!_isMan) exitWith {
    cutText ["You are not facing anyone.", "PLAIN DOWN"];
    };
    if (_wealth == _twealth) exitWith {
    cutText ["FAILED : Both Targets have same amount of money.", "PLAIN DOWN"];
    };   
    if (_InTrd) exitWith {
            cutText ["Other Player is busy, please wait.", "PLAIN DOWN"];
        };

    you can see the explantions of for example _twealth  its says :    _twealth = _target getVariable["cashMoney",0];

    so it means that _twealth is the coins of the target you are trying to give coins to  and then _amount = parseNumber (_this select 0);  is the ammount the player wants to give .

    so (_twealth + _amount ) if they add up to more then the LimitOnPlayer you created in variables the script will end with a cuttext saying its not possible because it is to much .

    Hope you understood it a bit since i am typing really fast in a hurry :D

     

  4. No you can add that in bankdialogwitgdrawamount like this  .

     

    BankDialogWithdrawAmount = {
    
    	private ["_amount","_bank","_wealth"];
    
    	_amount = parseNumber (_this select 0);	
    	_bank = player getVariable ["bankMoney", 0];
    	_wealth = player getVariable["cashMoney",0];
    	
    	if (LimitOnPlayer && ((_wealth + _amount ) >  MaxPlayerCoins )) exitWith { cutText ["You can only carry 950,000", "PLAIN DOWN"];};
    	if(_amount > 950000) exitWith { cutText ["You can not withdraw more then 950,000 coins at once.", "PLAIN DOWN"]; };
    	if(_amount < 1 or _amount > _bank) exitWith { cutText ["You can not withdraw more than is in your bank.", "PLAIN DOWN"]; };
    
    	player setVariable["cashMoney",(_wealth + _amount),true];
    	player setVariable["bankMoney",(_bank - _amount),true];
    
    	PVDZE_plr_Save = [player,(magazines player),true,true] ;
    	publicVariableServer "PVDZE_plr_Save";
    
    	PVDZE_bank_Save = [player];
    	publicVariableServer "PVDZE_bank_Save";
    
    	cutText [format["You have withdrawn %1 %2.", [_amount] call BIS_fnc_numberText, CurrencyName], "PLAIN DOWN"];
    
    };

    Also you will need to make an adjustment in your variables.sqf where the max bank amount is and add the limit on player is true or false and the amount .

    CurrencyName = "Coins"; // name of your currency
    LimitOnBank = true; // false = no limits, true = banks are limited on the value below
    MaxBankMoney = 1000000; // limit on bank for normal players
    DonatorBank = ["0"]; // Bigger banks, Players ID
    MaxDonatorBankMoney = 3000000; // Bank size for donators	
    InstantTrading = true; // (True = No Animation / False = Animation)
    LimitOnPlayer = true;
    MaxPlayerCoins = 950000; 

    If you read thru the dialogs and look carefull they will make sense and you will understand it .

    in this way you can cap anything you want with the coin system . giving money , banking money just about anything you just need to carefully read the coin init and try to understand it a bit .

    I did not come from a computer background infact few months ago i never seen a server file and i am a Carpenter but its not superhard just as long as you read carefully .

  5. 2 hours ago, Joshyy said:

    How do you cap the maximum pickup price, trasnfer amount and withdraw/deposite amount, may i ask 

    Thanks,

    i can show u mine

    check_wallet.sqf

    private ["_body", "_hisMoney", "_myMoney", "_killsH", "_test2", "_headShots", "_test","_playeridke","_humanity"];
    
    _body = _this select 3;
    
    _hisMoney = _body getVariable ["cashMoney",0];
    // Part to prevent them picking up to large amounds at once 
    if(_hisMoney > 950000) exitWith {
    		cutText ["This player has to many coins you cant pick it up it will bug your cash", "PLAIN DOWN"];
        };
    // This i put in trying to get rid of players being NULL'd
    if(_hisMoney < 1) exitWith {
    		cutText ["This Player/AI is a poor bastard and has no coins!!!", "PLAIN DOWN"];
        };
    _PlayerNear = _body call dze_isnearest_player;
    if (_PlayerNear) exitWith {cutText [localize "str_pickup_limit_4", "PLAIN DOWN"]};
    
    _name = _body getVariable ["bodyName","unknown"];
    _hisMoney = _body getVariable ["cashMoney",0];
    _myMoney = player getVariable ["cashMoney",0];
    _myMoney = _myMoney + _hisMoney;
    _body setVariable ["cashMoney", 0 , true];
    
    player setVariable ["cashMoney", _myMoney , true];
    
    systemChat format ['You took %1 coins, ID says %2 !',_hisMoney,_name];
    sleep 2;
    
    _cid =	player getVariable ["CharacterID","0"];
    _cashMoney = player getVariable ["cashMoney",0];
    
    if(_cashMoney > 0) then{
    
    } else {
    
    _cashMoney = 0;
    
    };	

    I put things like this in the init of my coin init .

    if (LimitOnPlayer && ((_wealth + _amount ) >  MaxPlayerCoins )) exitWith { cutText ["You can only carry 950,000", "PLAIN DOWN"];};

    Dont forget you need to make LimitOnPlayer and MaxPlayerCoins yourself in your variables.sqf like this for example

    LimitOnPlayer = true;
    MaxPlayerCoins = 950000;

     

     

  6. Could be i dont know i would be interested to see though , but there is no fix for it ?

    I've also seen a coin system working on what i think i is arma2net you have experience with that ?

    If so care to eplain some things to me ? :D

  7. Well i dont have the issue Antichrist since i capped all the amounts .

    Capped the amount of coins allowed to carry , capped prices , capped pick up amount , capped transfer amount ,capped amount you can redraw and deposite .

    Also fixed the dupe with giving eachother same amount at same time  .

    I noticed when people give coins over a mill then logg of and come back on it was duped , after all my fixes i never had the issue again .

  8. Have you even try'ed my code out? I think not. The code i provide you DON'T have to remove the  _isWreckBuilding  from it to remove anything in the array of  DZE_isWreckBuilding. Try it out.

    Both of ours works for only owners/anyone added to the plot pole with manage plot can remove the plot pole. No one else can.

    All you did is copy/paste from the default install for _isModular and _isModularDoor and put it inside this block of code. That is why you need to remove _isWreckBuilding from it to allow players to remove ammo crates.

    I copied/pasted some code from the  if (s_player_plotManagement < 0) then  block above and then wrote some of my own code so this does not need to be done.

    My code is setup for plot poles only  (if (_cursorTarget isKindOf "Plastic_Pole_EP1_DZ") then)  while not effecting anything else  ([{_player_deleteBuild = true},{_player_deleteBuild = false}]  }else{_player_deleteBuild = true};)

    If it is not a plot pole and has required tools it will let you remove it. Works for anything in the array for DZE_isWreck, DZE_isRemovable (Minus "Plastic_Pole_EP1_DZ") and DZE_isWreckBuilding inside variables.sqf.

    I understand you did yours this way for a good reason (make more items removable by owners and friends only because you added that stuff to the array's in variables.sqf) but our code is a lot different and is used for two similar but completely different reasons.

    If someone wants plot poles to be only removable by the owner/anyone added to the plot pole, both of our code works fine. However with mine they don't need to remove/make a new block of code for any of the _isDestructable || _isWreck || _isRemovable || _isWreckBuilding to allow players to remove stuff put inside those arrays in variables.sqf.

    Dude you are seriously reading over wat i am saying and i do not want to spend my time here to argue with you yes you have minus plastic pole , but i have more i want to be removed by owner or friend only in that array hence i seperated them .

    If i use your code i would have to do this if (_cursorTarget isKindOf "Plastic_Pole_EP1_DZ || StorageShed_DZ || GunRack_DZ || and so on so on ") then {

    because i want more stuff to removed by owner and friends only catch my drift now ?

     

  9. I tried it as well, and failed miserably. 

     

     

    Got it to work partially with using this from modular_build

    if (_hasrequireditem) then {
      
      //Create object that is attached to a player (i.e Ghost preview if available)
      _buildObject = [_classname, _ghost, _offset, true] call player_build_create;
      
      //define items collected from function
      _location1 = _buildObject select 0; //array
      _object = _buildObject select 1; //Obj
      _objectHelper = _buildObject select 2; //Obj
      
      _controls = [_object, _isAllowedUnderGround, _location1, _objectHelper] call player_build_controls;

      //define items collected from function
      _cancel = _controls select 0; //bool
      _reason = _controls select 1; //string
      _position = _controls select 2; //array
      _dir = _controls select 3; //int
      _vector = _controls select 4; //array
      
      //Publish item to a database
      [_cancel, _position, _classnametmp,_isAllowedUnderGround, _text, _isPole, _lockable,_dir, _reason, _vector] call player_build_publish;
     };

     

    The F function works but it cancels out the rest of the player_deploy .

    Maybe someobody with more skills then us is able to make the player_deploy call for the player_build_controls instead of using the controls from player_deploy .

  10. On my server players can remove these ammo box's no problem with my code. No need to make a new block for _isWreckBuilding  from what i see.

     

    		if(_isDestructable || _isWreck || _isRemovable || _isWreckBuilding) then {
    			if(_hasToolbox && "ItemCrowbar" in _itemsPlayer) then {
    				if (_cursorTarget isKindOf "Plastic_Pole_EP1_DZ") then {
                    _owner = _cursorTarget getVariable ["CharacterID","0"];
                    _friends = _cursorTarget getVariable ["plotfriends", []];
                    _fuid = [];
    				_allowed = [];
                   {
                    _friendUID = _x select 0;
                    _fuid = _fuid + [_friendUID];
                   } forEach _friends;
                    _allowed = [_owner];
    				_allowed = [_owner] + _fuid;	
    				if(_owner == dayz_characterID || (getPlayerUID player) in _allowed)then [{_player_deleteBuild = true},{_player_deleteBuild = false}]
    				}else{_player_deleteBuild = true};
    			};
    		};

    KEEP IN MIND THIS CODE IS NOT NEEDED FOR REMOVING OBJECTS WITHIN THE PLOT POLE. I DID THIS TO STOP BASE RAIDS. PEOPLE KEEP PUTTING THIS IN THINKING IT IS PART OF THE FIX FOR REMOVING OBJECTS. IT IS NOT PART OF IT.

    The code i provided is so only plotpole owners and people added on the plotpoles can remove the plotpole since a plotpole is in variables array in _isRemovable .

    other thent that i dont use wrecks on my server so could have deleted that the _isRemovable  also has some more items in it that i use on the server , so from the moment my code is used they are only removable by owners and friends .

    That's why i moved the _isWreckBuilding because that contains the ammo crates in  the array in variables .

    But your fix for plotpoles removable by owner works fine but so does mine i just seperated them to make more items removable by owners and friends only .

  11. I have put together some code that fixes this.

    How it works is if you are added to the plot pole with Manage plot you can remove any object at any time. Anybody added to the plot can remove anything even after death or server restart.

    In your fn_selfActions.sqf.

    Hidden Content

     

    ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    NOT PART OF THE FIX FOR REMOVING OBJECTS

    I have also set it up so if you are not the owner of/added to the plot pole with manage plot you can't remove the plot pole. I know not all servers want this but base take overs was out of control on my servers. This was the easy fix as i did not have to make a rule of no base take overs. Its just not possible.

    To do this open your fn_selfActions.sqf.

    Hidden Content

    Hope this helps some people. Cheers...

    Ive been using the same method and works fine but a little tip , if you want to use the ammoboxes (random crates with vehicle ammo) you might want to make a new line on your fn_selfactions for _isWreckBuilding .

    Otherwise your players wont be able to open them with a crowbar .

    Change your code to this

    if(_isDestructable || _isWreck || _isRemovable) then {
    			if(_hasToolbox && "ItemCrowbar" in _itemsPlayer) then {
    				if (_cursorTarget isKindOf "Plastic_Pole_EP1_DZ") then {
                    _owner = _cursorTarget getVariable ["CharacterID","0"];
                    _friends = _cursorTarget getVariable ["plotfriends", []];
                    _fuid = [];
    				_allowed = [];
                   {
                    _friendUID = _x select 0;
                    _fuid = _fuid + [_friendUID];
                   } forEach _friends;
                    _allowed = [_owner];
    				_allowed = [_owner] + _fuid;				
    				if(_owner == dayz_characterID || (getPlayerUID player) in _allowed)then [{_player_deleteBuild = true},{_player_deleteBuild = false}]
    				}else{_player_deleteBuild = true};
    			};
    		};

     

    And underneith add this

     

    if(_isWreckBuilding) then {
    			if(_hasToolbox && "ItemCrowbar" in _itemsPlayer) then {
    				_player_deleteBuild = true;
    			};
    		};	

     

    Also keep in mind that code for plotmanagement with p4l is different like this

     

    //Allow player to delete objects
    		if(_isDestructable || _isWreck || _isRemovable) then {
    			if(_hasToolbox && "ItemCrowbar" in _itemsPlayer) then {
    				_findNearestPoles = nearestObjects[player, ["Plastic_Pole_EP1_DZ"], DZE_PlotPole select 0];
    				_IsNearPlot = count (_findNearestPoles);
    				_fuid  = [];
    				_allowed = [];
    				if(_IsNearPlot > 0)then{
    					_thePlot = _findNearestPoles select 0;
    					_owner =  _thePlot getVariable ["ownerPUID","010"];
    					_friends = _thePlot getVariable ["plotfriends", []];
    					{
    					  _friendUID = _x select 0;
    					  _fuid  =  _fuid  + [_friendUID];
    					} forEach _friends;
    					_allowed = [_owner];    
    					_allowed = [_owner] +  _fuid;	
    					if ( _playerUID in _allowed && _ownerID in _allowed ) then {  
    						_player_deleteBuild = true;
    					};					
    				}else{
    					if(_ownerID == _playerUID)then{
    						_player_deleteBuild = true;
    					};
    				};						                  
                };

     

     

  12. Try adding this to your player_deploy

    on line 34 add

    DZE_F = false;

    and then line 314 add this

            if (DZE_F and _canDo) then {
                if (helperDetach) then {
                    _objectHelper attachTo [player];
                    DZE_memDir = DZE_memDir-(getDir player);
                    helperDetach = false;
                    [_objectHelper,[DZE_memForBack,DZE_memLeftRight,DZE_memDir]] call fnc_SetPitchBankYaw;
                } else {        
                    _objectHelperPos = getPosATL _objectHelper;
                    detach _objectHelper;            
                    DZE_memDir = getDir _objectHelper;
                    [_objectHelper,[DZE_memForBack,DZE_memLeftRight,DZE_memDir]] call fnc_SetPitchBankYaw;
                    _objectHelper setPosATL _objectHelperPos;
                    _objectHelper setVelocity [0,0,0]; //fix sliding glitch
                    helperDetach = true;
                };
                DZE_F = false;
            };

    look in the snap build folder & compare player_build.sqf to your player_deploy.sqf 

    Doesnt work tried it already , and when copying some parts over from player_build it destroys the player_deploy

  13. I still haven't been able to add Snap Build F key functionality to this yet, it's doing my head in. Here is my stock player_deploy : 

    http://pastebin.com/dxMtw0tT

    What would I have to add and where in order to get the F key (release) working? Any help would be amazing.

     

     

    Same for me would like to see this to

×
×
  • Create New...