Jump to content
  • 0
zulu

Override init variables dynamicly

Question

Hello,

i'd like to change a variable defined in the init dynamicly.
i execute a script in the init.sqf (checkhum.sqf) which checks players humanity and if humanity is greater 10K
values of "DZE_selfTransfuse_Values" should be raised.


checkhum.sqf: (called from inside the !is_dedicated brackets )

private['_hum'];

_hum=(player getVariable["humanity",0]);

if(_hum > 10000) then {

	DZE_selfTransfuse_Values = [12000, 15, 300]
}
else {
	DZE_selfTransfuse_Values = [1000, 15, 300]
};

My humanity is above 10K, but selfTransfuse_value is 1000, 15,300 and not 12000,15,300 as expected.

I also tried
if( (player getVariable["humanity",0]) > 10000) then {....
but without success.

What am i doing wrong?

 

 

Share this post


Link to post
Share on other sites

4 answers to this question

Recommended Posts

  • 0

You set this script after compiling medical scripts. you should compile script above

EpochEvents = [...
 

Just my opinion. Dont sure, dat ll help.

 

PLUS

private['_hum'];

_hum=(player getVariable["humanity",0]);

if(_hum > 10000) then {

	DZE_selfTransfuse_Values = [12000, 15, 300];
}
else {
	DZE_selfTransfuse_Values = [1000, 15, 300];
};

You forgot two ; in script.

Share this post


Link to post
Share on other sites
  • 0

None of that will work.

 

Why? Because the script checks once, (if even! - i don`t know how and from where the script is called) and then stops.

 

What you`ll want to do is:

 

  1. Wait for player to Log in
  2. Loop the script every time the player humanity changes.
  3. Don`t put useless brackets around
    player getVariable["humanity",0]

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

  • Similar Content

    • By Thug
      how to find the dayz map area of a map
      I know the following, but how do you come up with that number?
      dayz_MapArea
      This is the overall area used to determine where to spawn vehicles, road debris, and helicopter crashes. (Default: 10000)
      dayz_MapArea = 12000;
    • By zulu
      Hello,
      i have encountered a strange behavior when lowering the
      DZE_BuildingLimit = 150; to
      DZE_BuildingLimit = 10; When trying to build something it says "cannot build too many objects within 30m". But there is nothing build, nor there's a plotpole.
      Any idea?
       
    • By Just_R
      I have a question or two.   I watched a video by a well named person on these forums.  He basically stated we can move things from the init.sqf into the variables.sqf thus eliminating double calls to the dayz_code.pbo.  for example:
      spawnShoremode = 0; // Default = 1 (on shore) spawnArea= 800; // Default = 1500 DynamicVehicleDamageLow = 75; // Default: 0 DynamicVehicleDamageHigh = 100; // Default: 100 MaxVehicleLimit = 100; // Default = 50 MaxDynamicDebris = 0; // Default = 100 dayz_MapArea = 16000; // Default = 10000 MaxMineVeins = 1; MaxAmmoBoxes = 5; These above things can be stated at the beginning of variables.sqf, then repacked into the PBO.
      this being said, why can't we do this with compiles.sqf? fn_selfactions? etc? instead of copying these files to our MPMission folder plus the changes needed for the mod(s) -- so it ends up double calling things along with adding to an increased mission file? 
    • By Igirisujin
      After a quick discussion with one of the Epoch devs, it was suggested that I make this thread on behalf of server hosts and mod makers to allow as much customisation as possible without infringing the Epoch licence.
       
      Essentially, due to the inability to distribute modified versions of the Epoch mod, I hear there are going to be some variables we will be able to set in the mission/server files in order to enable/disable/adjust features within the mod. I'm unaware of exactly what these variables are going to be so here are a few suggestions that me and the rest of the DayZRP developer team have come up with.
       
      If anyone else wishes to add to this list of suggestions, feel free to reply and I'll throw them into the OP to keep them compiled together.
       
      Change spawnable creatures/mobs Creature/mob spawn rate/timer Creature/mob spawn numbers Dead body cleanup rate Trader inventories Loot tables Random event rates (earthquakes ..etc) Weather
    • By StiflersM0M
      Hey hey,
       
      Can anybody tell me how i can read stuff from the database ?
       
      i want to take the humanity from the database but dont know how i can do this.....
  • Advertisement
  • Supporters
  • Discord

×
×
  • Create New...