New Charakter with Kills from dead one

SchwEde

OpenDayZ Rockstar!
Hey guys,

I'm searching of an way where i can give a new character all the kills from the old dead one or prevent to set everything to 0 for the new character.

Thanks for any Help :)
 
I think it could be done through playersetup.sqf, there is also the part where the humanity is set but I'm terrible with "this select X;"
Will be alotnof trial and error in think (>﹏<)
 
so this sets the new humanity:
Code:
_humanity =        _primary select 5;
Code:
_playerObj setVariable["CharacterID",_characterID,true];
_playerObj setVariable["humanity",_humanity,true];
_playerObj setVariable["humanity_CHK",_humanity];

and this is for the kills:
Code:
_stats =        _primary select 2;
Code:
if (count _stats > 0) then {   
    //register stats
    _playerObj setVariable["zombieKills",(_stats select 0),true];
    _playerObj setVariable["headShots",(_stats select 1),true];
    _playerObj setVariable["humanKills",(_stats select 2),true];
    _playerObj setVariable["banditKills",(_stats select 3),true];
    _playerObj addScore (_stats select 1);
   
    //Save Score
    _score = score _playerObj;
    _playerObj addScore ((_stats select 0) - _score);
   
    //record for Server JIP checks
    _playerObj setVariable["zombieKills_CHK",(_stats select 0)];
    _playerObj setVariable["headShots_CHK",(_stats select 1)];
    _playerObj setVariable["humanKills_CHK",(_stats select 2)];
    _playerObj setVariable["banditKills_CHK",(_stats select 3)];

so i just edited it so it called right after the humanity but still everything 0
Think it should be done somehow with _stats select 0 but just dont know how -.-"

i appreciate any help
 
so this sets the new humanity:
Code:
_humanity =        _primary select 5;
Code:
_playerObj setVariable["CharacterID",_characterID,true];
_playerObj setVariable["humanity",_humanity,true];
_playerObj setVariable["humanity_CHK",_humanity];

and this is for the kills:
Code:
_stats =        _primary select 2;
Code:
if (count _stats > 0) then {  
    //register stats
    _playerObj setVariable["zombieKills",(_stats select 0),true];
    _playerObj setVariable["headShots",(_stats select 1),true];
    _playerObj setVariable["humanKills",(_stats select 2),true];
    _playerObj setVariable["banditKills",(_stats select 3),true];
    _playerObj addScore (_stats select 1);
  
    //Save Score
    _score = score _playerObj;
    _playerObj addScore ((_stats select 0) - _score);
  
    //record for Server JIP checks
    _playerObj setVariable["zombieKills_CHK",(_stats select 0)];
    _playerObj setVariable["headShots_CHK",(_stats select 1)];
    _playerObj setVariable["humanKills_CHK",(_stats select 2)];
    _playerObj setVariable["banditKills_CHK",(_stats select 3)];

so i just edited it so it called right after the humanity but still everything 0
Think it should be done somehow with _stats select 0 but just dont know how -.-"

i appreciate any help
I forgot humanity stays I see what I can come up with
 
so let me explain the select 0,1,2,3,4 crap for you since
I'm terrible with "this select X;"
so you have an array listed, like so.
Code:
_array = ["vil_Glock","ItemBandage","DZ_Patrol_Pack_EP1","FoodCanBakedBeans","ItemMatchbox_DZE","ItemPainkiller"] execVM "yourscripthere.sqf";
so you can use select blah to select specific items from these arrays in your script like so
Code:
_secondary = _this select 0;
_bandaid = _this select 1;
_bpack = _this select 2;
_food = _this select 3;
_matches = _this select 4;
_pills = _this select 5;

Anything you are using select for has to be defined in your script, or in the array calling your script.

Ebay does this magnificently in his script here http://opendayz.net/threads/release-ess-enhanced-spawn-selection.19998/

Hope I helped a little bit :D
 
Last edited:
ok thanks, this helps alot.

I still cant read out where i can find this stats:
server_playerSetup.sqf
Code:
_stats =        _primary select 2;
Code:
if (count _stats > 0) then {
    //register stats
    _playerObj setVariable["zombieKills",(_stats select 0),true];
    _playerObj setVariable["headShots",(_stats select 1),true];
    _playerObj setVariable["humanKills",(_stats select 2),true];
    _playerObj setVariable["banditKills",(_stats select 3),true];
    _playerObj addScore (_stats select 1);

Only connections i can find are these:

Code:
server_playerSetup =            compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_playerSetup.sqf";
Code:
"PVDZE_plr_Login2"        addPublicVariableEventHandler {(_this select 1) call server_playerSetup};

Code:
       "PVDZE_plr_Login2 = [_charID,player,_playerUID];" \n
       "publicVariableServer ""PVDZE_plr_Login2"";" \n

Code:
PVDZE_plr_Login2 = nil;

So where the heck are those stats? :confused:
 
I can't seem to locate where it calls on server_playerSetup to determine _characterID though.
 
Back
Top