Author Topic: Fun Scripts to use on servers?  (Read 3650 times)

0 Members and 1 Guest are viewing this topic.

robin-580

  • Online Villain
  • ***
  • Posts: 143
    • View Profile
Fun Scripts to use on servers?
« on: June 08, 2012, 09:46:07 pm »
anyone has some nice scripts to use on servers ?

MrMedic

  • MasstKer
  • ********
  • Posts: 8900
  • programmer/dev/software engineer
    • View Profile
Re: Fun Scripts to use on servers?
« Reply #1 on: June 08, 2012, 09:47:02 pm »
download the super cheat pack ,all of it still works.
EnCoded Message: i3iy9yl8kr2xf3g2Txs3pr6ye3ya7jg5ty2z

https://www.youtube.com/watch?v=62_7-AYfdkQ
you need a paypal account for the private versions.

Website:
http://bit.ly/medic101

Teamspeak 3: 85.236.101.5:10157

Buster

  • Klass Klown
  • ***
  • Posts: 295
  • Kool Kat
    • View Profile
Re: Fun Scripts to use on servers?
« Reply #2 on: June 08, 2012, 09:47:44 pm »
while in game press Alt+F4   :icon_thumbsup

MrMedic

  • MasstKer
  • ********
  • Posts: 8900
  • programmer/dev/software engineer
    • View Profile
Re: Fun Scripts to use on servers?
« Reply #3 on: June 08, 2012, 09:50:11 pm »
while in game press Alt+F4   :icon_thumbsup

Or the reset button on your pc for extra bullets.  :icon_thumbsup
EnCoded Message: i3iy9yl8kr2xf3g2Txs3pr6ye3ya7jg5ty2z

https://www.youtube.com/watch?v=62_7-AYfdkQ
you need a paypal account for the private versions.

Website:
http://bit.ly/medic101

Teamspeak 3: 85.236.101.5:10157

robin-580

  • Online Villain
  • ***
  • Posts: 143
    • View Profile
Re: Fun Scripts to use on servers?
« Reply #4 on: June 08, 2012, 09:51:17 pm »
trol lol alt f4 hahaha

darkrounge

  • Online Villain
  • ***
  • Posts: 166
    • View Profile
Re: Fun Scripts to use on servers?
« Reply #5 on: June 08, 2012, 09:55:23 pm »
anyone has some nice scripts to use on servers ?

Usually, since you've managed to get a bypass, you should KNOW HOW TO USE IT.

Therefore, code your own stuff.
Leaching stuff will only get you banned, so learn things new, majority of scripts are detected, therefore I highly suggest coding something else.

MrMedic

  • MasstKer
  • ********
  • Posts: 8900
  • programmer/dev/software engineer
    • View Profile
Re: Fun Scripts to use on servers?
« Reply #6 on: June 08, 2012, 10:03:50 pm »
trol lol alt f4 hahaha

rollerTrololage  :icon_laugh

lol at roflcopter and roflchopter ( thats one of my favourite as well as fuck off and die you cheating lowlife scumbag , or they ban me << love it when they do that ... ahaha meens im getting to them ).
EnCoded Message: i3iy9yl8kr2xf3g2Txs3pr6ye3ya7jg5ty2z

https://www.youtube.com/watch?v=62_7-AYfdkQ
you need a paypal account for the private versions.

Website:
http://bit.ly/medic101

Teamspeak 3: 85.236.101.5:10157

junkiemew

  • Poptart
  • *
  • Posts: 8
    • View Profile
Re: Fun Scripts to use on servers?
« Reply #7 on: June 08, 2012, 10:50:52 pm »
while in game press Alt+F4   :icon_thumbsup

Wow you're certainly funny

Coronel_Niel

  • Insane Joker
  • ****
  • Posts: 846
  • Why can't I pick my own profile picture...
    • View Profile
Re: Fun Scripts to use on servers?
« Reply #8 on: June 08, 2012, 10:55:42 pm »
Teleport everyone into a party bus and drive around while its locked. Doesn't work on the latest DayZ (Without a fair bit of modification) so don't use it on DayZ.
There's an infinite amount of things you can do. Went into a life server and spawned the cops and civs oppersite each other and gave each side RPG's.

PS: Does the new update to dev section mean everyone was removed?
"Now we are going to watch my boys do it" - Joopig

Energizer

  • Online Villain
  • ***
  • Posts: 121
    • View Profile
Re: Fun Scripts to use on servers?
« Reply #9 on: June 08, 2012, 11:10:50 pm »
anyone has some nice scripts to use on servers ?


Coronel_Niel

  • Insane Joker
  • ****
  • Posts: 846
  • Why can't I pick my own profile picture...
    • View Profile
Re: Fun Scripts to use on servers?
« Reply #10 on: June 08, 2012, 11:27:26 pm »
Couldn't find anywhere else to put this.

If you want to host your own server you need the following files:

\z\addons\dayz_server\system\server_monitor.sqf:

Code: [Select]
dayz_versionNo = getText(configFile >> "CfgMods" >> "DayZ" >> "version");
dayz_hiveVersionNo = getNumber(configFile >> "CfgMods" >> "DayZ" >> "hiveVersion");

if ((count playableUnits == 0) and !isDedicated) then {
isSinglePlayer = true;
};

waitUntil{initialized};

diag_log "HIVE: Starting";

//Stream in objects
/* STREAM OBJECTS */
//Send the key
_key = format["CHILD:302:%1:",dayZ_instance];
_data = "HiveEXT" callExtension _key;

diag_log "HIVE: Request sent";

//Process result
_result = call compile format ["%1",_data];
_status = _result select 0;

_myArray = [];
if (_status == "ObjectStreamStart") then {
_val = _result select 1;
//Stream Objects
diag_log ("HIVE: Commence Object Streaming...");
for "_i" from 1 to _val do {
_data = "HiveEXT" callExtension _key;
_result = call compile format ["%1",_data];
_status = _result select 0;
_myArray set [count _myArray,_result];
//diag_log ("HIVE: Loop ");
};
diag_log ("HIVE: Streamed " + str(_val) + " objects");
};

_countr = 0;
{

//Parse Array
_countr = _countr + 1;

_idKey = _x select 1;
_type = _x select 2;
_ownerID = _x select 3;
_dir = (_x select 4) select 0;
_pos = (_x select 4) select 1;
_intentory= _x select 5;
_hitPoints= _x select 6;
_fuel = _x select 7;
_damage = _x select 8;

if (_damage < 1) then {
diag_log ("OBJ: " + str(_idKey) + _type);

//Create it
_object = createVehicle [_type, _pos, [], 0, "CAN_COLLIDE"];
_object setVariable ["lastUpdate",time];
_object setVariable ["ObjectID", _idKey, true];
_object setVariable ["CharacterID", _ownerID, true];

clearWeaponCargoGlobal  _object;
clearMagazineCargoGlobal  _object;

if (_object isKindOf "TentStorage") then {
_pos set [2,0];
_object setpos _pos;
};
_object setdir _dir;
_object setDamage _damage;

if (count _intentory > 0) then {
//Add weapons
_objWpnTypes = (_intentory select 0) select 0;
_objWpnQty = (_intentory select 0) select 1;
_countr = 0;
{
_object addWeaponCargoGlobal [_x,(_objWpnQty select _countr)];
_countr = _countr + 1;
} forEach _objWpnTypes;

//Add Magazines
_objWpnTypes = (_intentory select 1) select 0;
_objWpnQty = (_intentory select 1) select 1;
_countr = 0;
{
_object addMagazineCargoGlobal [_x,(_objWpnQty select _countr)];
_countr = _countr + 1;
} forEach _objWpnTypes;

//Add Backpacks
_objWpnTypes = (_intentory select 2) select 0;
_objWpnQty = (_intentory select 2) select 1;
_countr = 0;
{
_object addBackpackCargoGlobal [_x,(_objWpnQty select _countr)];
_countr = _countr + 1;
} forEach _objWpnTypes;
};

if (_object isKindOf "AllVehicles") then {
{
_selection = _x select 0;
_dam = _x select 1;
if (_selection in dayZ_explosiveParts and _dam > 0.8) then {_dam = 0.8};
[_object,_selection,_dam] call object_setFixServer;
} forEach _hitpoints;
_object setvelocity [0,0,1];
_object setFuel _fuel;
if (getDammage _object == 1) then {
_position = ([(getPosATL _object),0,100,10,0,500,0] call BIS_fnc_findSafePos);
_object setPosATL _position;
};
_id = _object spawn fnc_vehicleEventHandler;
};

//Monitor the object
//_object enableSimulation false;
dayz_serverObjectMonitor set [count dayz_serverObjectMonitor,_object];
};
} forEach _myArray;

// # END OF STREAMING #

//Set the Time
//Send request
_key = "CHILD:307:";
_result = [_key] call server_hiveReadWrite;
_outcome = _result select 0;
if(_outcome == "PASS") then {
_date = _result select 1;
if(isDedicated) then {
setDate _date;
dayzSetDate = _date;
publicVariable "dayzSetDate";
};

diag_log ("HIVE: Local Time set to " + str(_date));
};

createCenter civilian;
if (isDedicated) then {
endLoadingScreen;
};
hiveInUse = false;

if (isDedicated) then {
_id = [] execFSM "\z\addons\dayz_server\system\server_cleanup.fsm";
};

//Spawn crashed helos
for "_x" from 1 to 5 do {
call spawn_heliCrash;
};

allowConnection = true;

\z\addons\dayz_server\init\server_functions.sqf:

Code: [Select]
object_spawnDamVehicle = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\object_spawnDamVehicle.sqf";
server_playerLogin = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_playerLogin.sqf";
server_playerSetup = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_playerSetup.sqf";
server_onPlayerDisconnect = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_onPlayerDisconnect.sqf";
server_routinePlayerCheck = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_routinePlayerCheck.sqf";
server_updateObject = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_updateObject.sqf";
server_playerDied = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_playerDied.sqf";
server_updatePlayer = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_updatePlayer.sqf";
server_playerStat = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_playerStat.sqf";
server_publishObj = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_publishObject.sqf";
local_publishObj = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\local_publishObj.sqf"; //Creates the object in DB
local_deleteObj = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\local_deleteObj.sqf"; //Creates the object in DB
local_createObj = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\local_createObj.sqf"; //Creates the object in DB
//onPlayerConnected "[_uid,_name] spawn server_onPlayerConnect;";
onPlayerDisconnected "[_uid,_name] call server_onPlayerDisconnect;";

server_hiveWrite = {
private["_resultArray","_data"];
diag_log ("ATTEMPT WRITE: " + _this);
_data = "HiveEXT" callExtension _this;
diag_log ("WRITE: " + _data);
};

server_hiveReadWrite = {
private["_key","_resultArray","_data"];
_key = _this select 0;
diag_log ("ATTEMPT READ/WRITE: " + _key);
_data = "HiveEXT" callExtension _key;
diag_log ("READ/WRITE: " + _data);
_resultArray = call compile format ["%1;",_data];
_resultArray;
};

spawn_heliCrash = {
private["_position","_veh","_num","_config","_itemType","_itemChance","_weights","_index","_iArray"];
_position = [getMarkerPos "center",0,4000,10,0,2000,0] call BIS_fnc_findSafePos;
_veh = createVehicle ["UH1Wreck_DZ",_position, [], 0, "CAN_COLLIDE"];
dayz_serverObjectMonitor set [count dayz_serverObjectMonitor,_veh];
_veh setVariable ["ObjectID",1,true];
dayzFire = [_veh,2,time,false,false];
publicVariable "dayzFire";
if (isServer) then {
nul=dayzFire spawn BIS_Effects_Burn;
};
_num = round(random 4) + 3;
_config = configFile >> "CfgBuildingLoot" >> "HeliCrash";
_itemType = getArray (_config >> "itemType");
_itemChance = getArray (_config >> "itemChance");
_weights = [_itemType,_itemChance] call fnc_buildWeightedArray;
for "_x" from 1 to _num do {
//create loot
_index = _weights call BIS_fnc_selectRandom;
_iArray = _itemType select _index;
_iArray set [2,_position];
_iArray set [3,5];
_iArray call spawn_loot;
_nearby = _position nearObjects ["WeaponHolder",20];
{
_x setVariable ["permaLoot",true];
} forEach _nearBy;
};
};

server_getDiff = {
private["_variable","_object","_vNew","_vOld","_result"];
_variable = _this select 0;
_object = _this select 1;
_vNew = _object getVariable[_variable,0];
_vOld = _object getVariable[(_variable + "_CHK"),_vNew];
_result = 0;
if (_vNew < _vOld) then {
//JIP issues
_vNew = _vNew + _vOld;
_object getVariable[(_variable + "_CHK"),_vNew];
} else {
_result = _vNew - _vOld;
_object setVariable[(_variable + "_CHK"),_vNew];
};
_result
};

server_getDiff2 = {
private["_variable","_object","_vNew","_vOld","_result"];
_variable = _this select 0;
_object = _this select 1;
_vNew = _object getVariable[_variable,0];
_vOld = _object getVariable[(_variable + "_CHK"),_vNew];
_result = _vNew - _vOld;
_object setVariable[(_variable + "_CHK"),_vNew];
_result
};

dayz_objectUID = {
private["_position","_p1","_p2","_p3","_dir","_key","_object"];
_object = _this;
_position = getPosATL _object;
_p1 = round((_position select 0) * 10);
_p2 = round((_position select 1) * 10);
_p3 = round((_position select 2) * 10);
_dir = round(direction _object);
_key = format["%1%2%3%4",_p1,_p2,_p3,_dir];
_key
};

dayz_objectUID2 = {
private["_position","_p1","_p2","_p3","_dir","_key"];
_dir = _this select 0;
_position = _this select 1;
_p1 = round((_position select 0) * 10);
_p2 = round((_position select 1) * 10);
_p3 = round((_position select 2) * 10);
_key = format["%1%2%3%4",_p1,_p2,_p3,_dir];
_key
};

\z\addons\dayz_server\compile\server_playerLogin.sqf:
Code: [Select]
private["_int","_newModel","_doLoop","_wait","_hiveVer","_isHiveOk","_playerID","_playerObj","_randomSpot","_publishTo","_primary","_secondary","_key","_result","_charID","_playerObj","_playerName","_finished","_spawnPos","_spawnDir","_items","_counter","_magazines","_weapons","_group","_backpack","_worldspace","_direction","_newUnit","_score","_position","_isNew","_inventory","_backpack","_medical","_survival","_stats","_state"];
//Set Variables
_playerID = _this select 0;
_playerObj = _this select 1;
_playerName = name _playerObj;
_worldspace = [];

if (count _this > 2) then {
dayz_players = dayz_players - [_this select 2];
};

waitUntil{allowConnection};

//Variables
_inventory = [];
_backpack = [];
_items = [];
_magazines = [];
_weapons = [];
_medicalStats = [];
_survival = [0,0,0];
_tent = [];
_state = [];
_direction = 0;
_model = "";
_newUnit = objNull;

if (_playerID == "") then {
_playerID = getPlayerUID _playerObj;
};

if ((_playerID == "") or (isNil "_playerID")) exitWith {
diag_log ("LOGIN FAILED: Player [" + _playerName + "] has no login ID");
};

endLoadingScreen;
diag_log ("LOGIN ATTEMPT: " + str(_playerID) + " " + _playerName);

//Do Connection Attempt
_doLoop = 0;
while {_doLoop < 5} do {
_key = format["CHILD:101:%1:%2:%3:",_playerID,dayZ_instance,_playerName];
_primary = [_key,false,dayZ_hivePipeAuth] call server_hiveReadWrite;
if (count _primary > 0) then {
if ((_primary select 0) != "ERROR") then {
_doLoop = 9;
};
};
_doLoop = _doLoop + 1;
};

if (isNull _playerObj or !isPlayer _playerObj) exitWith {
diag_log ("LOGIN RESULT: Exiting, player object null: " + str(_playerObj));
};

//Process request
_newPlayer = _primary select 1;
_isNew = count _primary < 6; //_result select 1;
_charID = _primary select 2;
_randomSpot = false;

diag_log ("LOGIN RESULT: " + str(_primary));

/* PROCESS */
_hiveVer = 0;

if (!_isNew) then {
//RETURNING CHARACTER
_inventory = _primary select 4;
_backpack = _primary select 5;
_survival = _primary select 6;
_model = _primary select 7;
_hiveVer = _primary select 8;
} else {
_model = _primary select 3;
_hiveVer = _primary select 4;
if (isNil "_model") then {
_model = "Survivor2_DZ";
} else {
if (_model == "") then {
_model = "Survivor2_DZ";
};
};
if (_model != "SurvivorW2_DZ") then {
_model = "Survivor2_DZ";
};
//Record initial inventory
_config = (configFile >> "CfgSurvival" >> "Inventory" >> "Default");
_mags = getArray (_config >> "magazines");
_wpns = getArray (_config >> "weapons");
_bcpk = getText (_config >> "backpack");
_randomSpot = true;

//Wait for HIVE to be free
_key = format["CHILD:203:%1:%2:%3:",_charID,[_wpns,_mags],[_bcpk,[],[]]];
_key spawn server_hiveWrite;

};
diag_log ("LOGIN LOADED: " + str(_playerObj) + " Type: " + (typeOf _playerObj));

_isHiveOk = false;
if (_hiveVer >= dayz_hiveVersionNo) then {
_isHiveOk = true;
};
diag_log ("SERVER RESULT: " + str("X") + " " + str(dayz_hiveVersionNo));

//Server publishes variable to clients and WAITS
_playerObj setVariable ["publish",[_charID,_inventory,_backpack,_survival,_isNew,dayz_versionNo,_model,_isHiveOk,_newPlayer],true];

//_playerObj enableSimulation false;


That's it I believe. Really don't support this "We will give servers to people with lots of money or youtube viewers because this helps 'The Community'".

NOTE: Still going to need the Hive files. Look around from them, lots of people have them.
« Last Edit: June 08, 2012, 11:37:25 pm by Coronel_Niel »
"Now we are going to watch my boys do it" - Joopig

Buster

  • Klass Klown
  • ***
  • Posts: 295
  • Kool Kat
    • View Profile
Re: Fun Scripts to use on servers?
« Reply #11 on: June 08, 2012, 11:32:47 pm »
Well done buddy, and thanks for sharing with 'The Community'.  :icon_thumbsup

+1

Coronel_Niel

  • Insane Joker
  • ****
  • Posts: 846
  • Why can't I pick my own profile picture...
    • View Profile
Re: Fun Scripts to use on servers?
« Reply #12 on: June 08, 2012, 11:36:16 pm »


server_onPlayerDisconnect.sqf (Same file structure and place as others):

Code: [Select]
private["_hasDel","_serial","_object","_updates","_myGroup","_nearVeh"];
_playerID = _this select 0;
_playerName = _this select 1;
_object = call compile format["player%1",_playerID];

if (vehicle _object != _object) then {
_object action ["eject", vehicle _object];
};

diag_log ("DISCONNECT: " + _playerName + " (" + str(_playerID) + ") Object: " + str(_object) );

_object setVariable["medForceUpdate",true];
_object setVariable["updatePlayer",[true,true,true,false,false]];
_object call server_updatePlayer;

//dayz_players = dayz_players - [_object];

//Update Vehicle
if (!isNull _object) then {
_nearVeh = nearestObjects [_object, ["AllVehicles","TentStorage"], 20];
{
[_x,"gear"] call server_updateObject;
if (_x isKindOf "AllVehicles") then {
[_x,"repair"] call server_updateObject;
[_x,"position"] call server_updateObject;
};
} forEach _nearVeh;
};

//Delete group
if (!isNull _object) then {
if (alive _object) then {
_myGroup = group _object;
deleteVehicle _object;
deleteGroup _myGroup;
};
};

\z\addons\dayz_server\compile\server_routinePlayerCheck.sqf:

Code: [Select]
private["_unitArray","_handle"];
_unitArray = [];
if (isSinglePlayer) then {
_unitArray = [player];
} else {
_unitArray = dayz_players;
};
{
if (!isNull _x) then {
diag_log ("SERVER: Routine Player Check: " + str(_x));
_handle = _x spawn server_updatePlayer;
waitUntil{scriptDone _handle};
};
} forEach _unitArray;

\z\addons\dayz_server\compile\server_updateObject.sqf:

Code: [Select]
private["_objectID","_object","_updates","_uGear","_key","_result","_position","_speed","_crew","_canDo","_uid","_type","_previous"];
_object = _this select 0;
_objectID = _object getVariable ["ObjectID",0];
_uid = _object call dayz_objectUID;
_type = _this select 1;
_speed = speed _object;
_crew = driver _object;
_canDo = false;
_key = "";
_lastUpdate = _object getVariable ["lastUpdate",time];

_object setVariable ["lastUpdate",time];
switch (_type) do {
case "all": {
_position = getPosATL _object;
_worldspace = [
round(direction _object),
_position
];
_key = format["CHILD:305:%1:%2:%3:",_objectID,_worldspace,fuel _object];
diag_log ("HIVE: WRITE: "+ str(_key));
_key call server_hiveWrite;
_inventory = [
getWeaponCargo _object,
getMagazineCargo _object,
getBackpackCargo _object
];
_previous = str(_object getVariable["lastInventory",[]]);
if (str(_inventory) != _previous) then {
_object setVariable["lastInventory",_inventory];
if (_objectID == 0) then {
_key = format["CHILD:309:%1:%2:",_uid,_inventory];
} else {
_key = format["CHILD:303:%1:%2:",_objectID,_inventory];
};
diag_log ("HIVE: WRITE: "+ str(_key));
_key call server_hiveWrite;
};
_hitpoints = _object call vehicle_getHitpoints;
_array = [];
_dam = 1;
{
_hit = [_object,_x] call object_getHit;
_selection = getText (configFile >> "CfgVehicles" >> (typeOf _object) >> "HitPoints" >> _x >> "name");
if (_hit > 0) then {_array set [count _array,[_selection,_hit]]};
} forEach _hitpoints;
_key = format["CHILD:306:%1:%2:%3:",_objectID,_array,damage _object];
diag_log ("HIVE: WRITE: "+ str(_key));
_key call server_hiveWrite;
};
case "position": {
_position = getPosATL _object;
_worldspace = [
round(direction _object),
_position
];
_key = format["CHILD:305:%1:%2:%3:",_objectID,_worldspace,fuel _object];
diag_log ("HIVE: WRITE: "+ str(_key));
_key call server_hiveWrite;
};
case "gear": {
_inventory = [
getWeaponCargo _object,
getMagazineCargo _object,
getBackpackCargo _object
];
_previous = str(_object getVariable["lastInventory",[]]);
if (str(_inventory) != _previous) then {
_object setVariable["lastInventory",_inventory];
if (_objectID == 0) then {
_key = format["CHILD:309:%1:%2:",_uid,_inventory];
} else {
_key = format["CHILD:303:%1:%2:",_objectID,_inventory];
};
diag_log ("HIVE: WRITE: "+ str(_key));
_key call server_hiveWrite;
};
};
case "damage": {
if ((time - _lastUpdate) > 5) then {
_hitpoints = _object call vehicle_getHitpoints;
_array = [];
_dam = 1;
{
_hit = [_object,_x] call object_getHit;
_selection = getText (configFile >> "CfgVehicles" >> (typeOf _object) >> "HitPoints" >> _x >> "name");
if (_hit > 0) then {_array set [count _array,[_selection,_hit]]};
} forEach _hitpoints;
_key = format["CHILD:306:%1:%2:%3:",_objectID,_array,damage _object];
diag_log ("HIVE: WRITE: "+ str(_key));
_key call server_hiveWrite;
};
};
case "repair": {
_hitpoints = _object call vehicle_getHitpoints;
_array = [];
_dam = 1;
{
_hit = [_object,_x] call object_getHit;
_selection = getText (configFile >> "CfgVehicles" >> (typeOf _object) >> "HitPoints" >> _x >> "name");
if (_hit > 0) then {_array set [count _array,[_selection,_hit]]};
} forEach _hitpoints;
_key = format["CHILD:306:%1:%2:%3:",_objectID,_array,damage _object];
diag_log ("HIVE: WRITE: "+ str(_key));
_key call server_hiveWrite;
};
};

\z\addons\dayz_server\compile\server_playerDied.sqf:

Code: [Select]
private["_characterID","_minutes","_newObject","_playerID","_playerName","_playerID","_myGroup","_group"];
//[unit, weapon, muzzle, mode, ammo, magazine, projectile]
_characterID = _this select 0;
_minutes = _this select 1;
_newObject = _this select 2;
_playerID = _this select 3;
_playerName = _this select 4;

dayz_disco = dayz_disco - [_playerID];
_newObject setVariable["processedDeath",time];
if (_characterID != "0") then {
_key = format["CHILD:202:%1:%2:",_characterID,_minutes];
diag_log ("HIVE: WRITE: "+ str(_key));
_key call server_hiveWrite;
} else {
deleteVehicle _newObject;
};


diag_log ("PDEATH: Player Died " + _playerID);
/*
_eh = [_newObject] spawn {
_body = _this select 0;
_method = _body getVariable["deathType","unknown"];
_name = _body getVariable["bodyName","unknown"];
waitUntil{!isPlayer _body;sleep 1};
_body setVariable["deathType",_method,true];
_body setVariable["bodyName",_name,true];
diag_log ("PDEATH: Player Left Body " + _name);
};
*/
//dead_bodyCleanup set [count dead_bodyCleanup,_newObject];

\z\addons\dayz_server\compile\server_updatePlayer.sqf:

Code: [Select]
private["_characterID","_currentModelCheck","_temp","_isSync","_currentWpn","_currentMag","_magazines","_qty","_qtyT","_val","_isNewPos","_isNewBackp","_humanity","_isNewGear","_doUpdate","_currentModel","_modelChk","_playerPos","_playerGear","_playerBackp","_backpack","_updates","_killsB","_killsH","_medical","_isNewMed","_character","_timeSince","_charPos","_isInVehicle","_justAte","_justDrank","_distanceFoot","_lastPos","_legs","_arms","_kills","_headShots","_killsCHK","_headShotsCHK","_timeGross","_timeLeft","_onLadder","_isTerminal"];
_character = _this;
_doUpdate = false;
_characterID = _character getVariable ["characterID","0"];
_updates = _character getVariable ["updatePlayer",[false,false,false,false,false]];
_charPos = getPosATL _character;
_isInVehicle = vehicle _character != _character;
_timeSince = 0;
_humanity = 0;

if (_characterID == "0") exitWith {
diag_log ("ERROR: Cannot Sync Character " + (name _character) + " as no characterID");
};

//CheckVehicle
_character allowDamage true;
if (_isInVehicle) then {
_vehicle = (vehicle _character);
_isSync = _vehicle getVariable ["ObjectID",0] > 0;
if (!_isSync) then {
_vehicle allowDamage true;
_vehicle setDamage 1;
_character setVelocity [0,0,100];
};
};

//Check for server initiated updates
_isNewMed = _character getVariable["medForceUpdate",false]; //Med Update is forced when a player receives some kind of med incident

//Check for player initiated updates
if ((count _updates > 0 or _isNewMed) and _characterID != "0") then {
_isNewPos = _updates select 0;
_isNewGear = _updates select 1;
_isNewBackp = _updates select 2;
_justAte = _updates select 3;
_justDrank = _updates select 4;
_playerPos = [];
_playerGear = [];
_playerBackp = [];
_medical = [];
_distanceFoot = 0;

//Check if update is requested
if (_isNewPos) then {
if (((_charPos select 0) == 0) and ((_charPos select 1) == 0)) then {
//Zero Position
} else {
_playerPos = [round(direction _character),_charPos];
_lastPos = _character getVariable["lastPos",_charPos];
if (count _lastPos > 2 and count _charPos > 2) then {
if (!_isInVehicle) then {
_distanceFoot = round(_charPos distance _lastPos);
if (_distanceFoot > 500) then {
_distanceFoot = 0;
} else {
_doUpdate = true;
};
};
_character setVariable["lastPos",_charPos];
};
};
};
if (_isNewGear) then {
//player sideChat format["SERVER: %1 update backpack",_characterID];
_currentWpn = currentMuzzle _character;
_currentMag = currentMagazine _character;
_magazines = magazines _character;

_qty = _character ammo _currentWpn;
_qtyT = getNumber(configFile >> "cfgMagazines" >> _currentMag >> "count");
if (_qty < (_qtyT * 0.5)) then {
_val = _magazines find _currentMag;
_magazines set [_val,"DEL"];
_magazines = _magazines - ["DEL"];
};
_playerGear = [weapons _character,_magazines];
_doUpdate = true;
};
if (_isNewBackp) then {
//player sideChat format["SERVER: %1 update inventory",_characterID];
_backpack = unitBackpack _character;
_playerBackp = [typeOf _backpack,getWeaponCargo _backpack,getMagazineCargo _backpack];
_doUpdate = true;
};
if (_isNewMed) then {
//player sideChat format["SERVER: %1 update medical",_characterID];
_wounds = [];
if (!(_character getVariable["USEC_isDead",false])) then {
_medical = _character call player_sumMedical;
_doUpdate = true;
};
};

//Process update
if (_doUpdate and _characterID != "0") then {
//Record stats while we're here
/*
Check previous stats against what client had when they logged in
this helps prevent JIP issues, where a new player wouldn't have received
the old players updates. Only valid for stats where clients could have
be recording  results from their local objects (such as agent zombies)
*/
_kills = ["zombieKills",_character] call server_getDiff;
_killsB = ["banditKills",_character] call server_getDiff;
_killsH = ["humanKills",_character] call server_getDiff;
_headShots = ["headShots",_character] call server_getDiff;
_humanity = ["humanity",_character] call server_getDiff2;
//_humanity = _character getVariable ["humanity",0];
_character addScore _kills;
/*
Assess how much time has passed, for recording total time on server
*/
_lastTime = _character getVariable["lastTime",time];
_timeGross = (time - _lastTime);
_timeSince = floor(_timeGross / 60);
_timeLeft = (_timeGross - (_timeSince * 60));
/*
Get character state details
*/
_currentWpn = currentMuzzle _character;
_currentAnim = animationState _character;
_config = configFile >> "CfgMovesMaleSdr" >> "States" >> _currentAnim;
_onLadder = (getNumber (_config >> "onLadder")) == 1;
_isTerminal = (getNumber (_config >> "terminal")) == 1;
//_wpnDisabled = (getNumber (_config >> "disableWeapons")) == 1;
_currentModel = typeOf _character;
_modelChk = _character getVariable ["model_CHK",""];
if (_currentModel == _modelChk) then {
_currentModel = "";
} else {
_currentModel = str(_currentModel);
_character setVariable ["model_CHK",typeOf _character];
};

if (_onLadder or _isInVehicle or _isTerminal) then {
_currentAnim = "";
//If position to be updated, make sure it is at ground level!
if ((count _playerPos > 0) and !_isTerminal) then {
_charPos set [2,0];
_playerPos set[1,_charPos];
};
};
if (_isInVehicle) then {
_currentWpn = "";
} else {
_muzzles = getArray(configFile >> "cfgWeapons" >> _currentWpn >> "muzzles");
if (count _muzzles > 1) then {
_currentWpn = currentMuzzle _character;
};
};
_temp = round(_character getVariable ["temperature",100]);
_currentState = [_currentWpn,_currentAnim,_temp];
/*
Everything is ready, now publish to HIVE
*/
if (count _playerPos > 0) then {
_array = [];
{
if (_x > -20000 and _x < 20000) then {
_array set [count _array,_x];
};
} forEach (_playerPos select 1);
_playerPos set [1,_array];
};
if (!isNull _character) then {
if (alive _character) then {
//Wait for HIVE to be free
//Send request
_key = format["CHILD:201:%1:%2:%3:%4:%5:%6:%7:%8:%9:%10:%11:%12:%13:%14:%15:%16:",_characterID,_playerPos,_playerGear,_playerBackp,_medical,_justAte,_justDrank,_kills,_headShots,_distanceFoot,_timeSince,_currentState,_killsH,_killsB,_currentModel,_humanity];
diag_log ("HIVE: WRITE: "+ str(_key) + " / " + _characterID);
_key call server_hiveWrite;
_character setVariable ["updatePlayer",[false,false,false,false,false],true];
_character setVariable ["medForceUpdate",false];
};
};

//Reset timer
if (_timeSince > 0) then {
_character setVariable ["lastTime",(time - _timeLeft)];
};
};
};

\z\addons\dayz_server\compile\server_playerStat.sqf:

Code: [Select]
private[];
_unit = _this select 0;
_variable = _this select 1;
_change = _this select 2;

\z\addons\dayz_server\compile\server_publishObject.sqf:

Code: [Select]
private["_type","_location","_dir","_character","_tent","_class","_id","_uid"];
//[dayz_characterID,_tent,[_dir,_location],"TentStorage"]
_charID = _this select 0;
_object = _this select 1;
_worldspace = _this select 2;
_class = _this select 3;
_id = 0;

diag_log ("PUBLISH: Attempt " + str(_object));
_dir = _worldspace select 0;
_location = _worldspace select 1;

//get UID
_uid = _worldspace call dayz_objectUID2;

//Send request
_key = format["CHILD:308:%1:%2:%3:%4:%5:%6:%7:%8:%9:",dayZ_instance, _class, 0 , _charID, _worldspace, [], [], 0,_uid];
diag_log ("HIVE: WRITE: "+ str(_key));
_key call server_hiveWrite;

_object setVariable ["ObjectUID", _uid];

dayz_serverObjectMonitor set [count dayz_serverObjectMonitor,_object];

diag_log ("PUBLISH: Created " + (_class) + " with ID " + _uid);
"Now we are going to watch my boys do it" - Joopig

Coronel_Niel

  • Insane Joker
  • ****
  • Posts: 846
  • Why can't I pick my own profile picture...
    • View Profile
Re: Fun Scripts to use on servers?
« Reply #13 on: June 08, 2012, 11:37:42 pm »
\z\addons\dayz_server\compile\server_playerSetup.sqf:

Code: [Select]
private["_int","_characterID","_doLoop","_newModel","_wait","_playerID","_playerObj","_randomSpot","_publishTo","_primary","_secondary","_key","_result","_charID","_playerObj","_playerName","_finished","_spawnPos","_spawnDir","_items","_counter","_magazines","_weapons","_group","_backpack","_worldspace","_direction","_newUnit","_score","_position","_pos","_isIsland","_isNew","_inventory","_backpack","_medical","_survival","_stats","_state"];
//Set Variables
//Wait for HIVE to be free
diag_log ("SETUP: attempted with " + str(_this));

_characterID = _this select 0;
_playerObj = _this select 1;
_playerID = _this select 2;

if (isNull _playerObj) exitWith {
diag_log ("SETUP INIT FAILED: Exiting, player object null: " + str(_playerObj));
};

if (_playerID == "") then {
_playerID = getPlayerUID _playerObj;
};

if (_playerID == "") exitWith {
diag_log ("SETUP INIT FAILED: Exiting, no player ID: " + str(_playerObj));
};

//Variables
_worldspace = [];
_survival = [0,0,0];
_tent = [];
_state = [];

//Do Connection Attempt
_doLoop = 0;
while {_doLoop < 5} do {
_key = format["CHILD:102:%1:",_characterID];
_primary = [_key,false,dayZ_hivePipeAuth] call server_hiveReadWrite;
if (count _primary > 0) then {
if ((_primary select 0) != "ERROR") then {
_doLoop = 9;
};
};
_doLoop = _doLoop + 1;
};

if (isNull _playerObj or !isPlayer _playerObj) exitWith {
diag_log ("SETUP RESULT: Exiting, player object null: " + str(_playerObj));
};

//Wait for HIVE to be free
diag_log ("SETUP: RESULT: Successful with " + str(_primary));

_medical = _primary select 1;
_stats = _primary select 2;
_state = _primary select 3;
_worldspace = _primary select 4;
_humanity = _primary select 5;

//Set position
_randomSpot = false;

if (count _worldspace > 0) then {
_direction = _worldspace select 0;
_position = _worldspace select 1;
//_playerObj setPosATL _position;
//_playerObj setDir _direction;
} else {
_randomSpot = true;
};

diag_log ("LOGIN: Location: " + str(_worldspace) + " doRnd?: " + str(_randomSpot));

//set medical values
if (count _medical > 0) then {
_playerObj setVariable["USEC_isDead",(_medical select 0),true];
_playerObj setVariable["NORRN_unconscious", (_medical select 1), true];
_playerObj setVariable["USEC_infected",(_medical select 2),true];
_playerObj setVariable["USEC_injured",(_medical select 3),true];
_playerObj setVariable["USEC_inPain",(_medical select 4),true];
_playerObj setVariable["USEC_isCardiac",(_medical select 5),true];
_playerObj setVariable["USEC_lowBlood",(_medical select 6),true];
_playerObj setVariable["USEC_BloodQty",(_medical select 7),true];
if (_playerID in dayz_disco) then {
_playerObj setVariable["NORRN_unconscious",true, true];
_playerObj setVariable["unconsciousTime",300,true];
} else {
_playerObj setVariable["unconsciousTime",(_medical select 10),true];
};

//Add Wounds
{
_playerObj setVariable[_x,true,true];
[_playerObj,_x,_hit] spawn fnc_usec_damageBleed;
usecBleed = [_playerObj,_x,0];
publicVariable "usecBleed";
} forEach (_medical select 8);

//Add fractures
_fractures = (_medical select 9);
_playerObj setVariable ["hit_legs",(_fractures select 0),true];
_playerObj setVariable ["hit_hands",(_fractures select 1),true];
} else {
//Reset Fractures
_playerObj setVariable ["hit_legs",0,true];
_playerObj setVariable ["hit_hands",0,true];
_playerObj setVariable ["USEC_injured",false,true];
_playerObj setVariable ["USEC_inPain",false,true];
};

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)];
if (count _stats > 4) then {
if (!(_stats select 3)) then {
_playerObj setVariable["selectSex",true,true];
};
} else {
_playerObj setVariable["selectSex",true,true];
};
} else {
//Save initial loadout
//register stats
_playerObj setVariable["zombieKills",0,true];
_playerObj setVariable["humanKills",0,true];
_playerObj setVariable["banditKills",0,true];
_playerObj setVariable["headShots",0,true];

//record for Server JIP checks
_playerObj setVariable["zombieKills_CHK",0];
_playerObj setVariable["humanKills_CHK",0,true];
_playerObj setVariable["banditKills_CHK",0,true];
_playerObj setVariable["headShots_CHK",0];
};

if (_randomSpot) then {
private["_counter","_position","_isNear","_isZero","_mkr"];
if (!isDedicated) then {
endLoadingScreen;
};

//spawn into random
_findSpot = true;
_mkr = "";
while {_findSpot} do {
_counter = 0;
while {_counter < 20 and _findSpot} do {
_mkr = "spawn" + str(round(random 4));
_position = ([(getMarkerPos _mkr),0,1500,10,0,2000,1] call BIS_fnc_findSafePos);
_isNear = count (_position nearEntities ["Man",100]) == 0;
_isZero = ((_position select 0) == 0) and ((_position select 1) == 0);
//Island Check //TeeChange
_pos = _position;
_isIsland = false; //Can be set to true during the Check
for [{_w=0},{_w<=150},{_w=_w+2}] do {
_pos = [(_pos select 0),((_pos select 1) + _w),(_pos select 2)];
if(surfaceisWater _pos) exitWith {
_isIsland = true;
};
};

if ((_isNear and !_isZero) || _isIsland) then {_findSpot = false};
_counter = _counter + 1;
};
};
_isZero = ((_position select 0) == 0) and ((_position select 1) == 0);
_position = [_position select 0,_position select 1,0];
if (!_isZero) then {
//_playerObj setPosATL _position;
_worldspace = [0,_position];
};
};


//Record player for management
dayz_players set [count dayz_players,_playerObj];

//record player pos locally for server checking
_playerObj setVariable["characterID",_characterID,true];
_playerObj setVariable["humanity",_humanity,true];
_playerObj setVariable["humanity_CHK",_humanity];
_playerObj setVariable["worldspace",_worldspace,true];
_playerObj setVariable["state",_state,true];
_playerObj setVariable["lastPos",getPosATL _playerObj];

//record time started
_playerObj setVariable ["lastTime",time];
//_playerObj setVariable ["model_CHK",typeOf _playerObj];

diag_log ("LOGIN PUBLISHING: " + str(_playerObj) + " Type: " + (typeOf _playerObj));

//Record player for management
myObj = _playerObj;
call compile format["player%1 = myObj;",_playerID];
diag_log (format["player%1 = myObj",_playerID]);
//dayz_players set [count dayz_players,_playerObj];
"Now we are going to watch my boys do it" - Joopig

M. O.

  • Administrator
  • MasstKer
  • *
  • Posts: 9185
    • View Profile
    • http://www.tkc-community.net
« Last Edit: June 09, 2012, 12:15:58 am by M. O. »
Heckling is an art, and game hacking a science.