Send dayz_playerName as array

This avoids triggering PV value restrictions when the player has
keywords or special characters in their name.
This commit is contained in:
ebaydayz
2016-03-20 22:12:11 -04:00
parent 92c09e5c7b
commit f0757b1544
22 changed files with 136 additions and 282 deletions

View File

@@ -1,43 +1,43 @@
private ["_animalbody","_qty","_rawfoodtype"];
_animalbody = _this select 0;
_qty = _this select 1;
_rawfoodtype = getText (configFile >> "CfgSurvival" >> "Meat" >> typeOf _animalbody >> "rawfoodtype");
if (local _animalbody) then {
_qty = _this select 1;
_rawfoodtype = getText (configFile >> "CfgSurvival" >> "Meat" >> typeOf _animalbody >> "rawfoodtype");
for "_x" from 1 to _qty do {
for "_i" from 1 to _qty do {
_animalbody addMagazine _rawfoodtype;
};
if (typeOf _animalbody == "Hen") then {
_amount = (floor (random 4)) + 2;
for "_x" from 1 to _amount do {
_animalbody addMagazine "equip_feathers";
};
};
[time, _animalbody] spawn {
private ["_timer", "_body"];
};
[time, _animalbody] spawn {
_timer = _this select 0;
_body = _this select 1;
_pos = getPosATL _body;
while {(count magazines _body >0) && (time - _timer < 300) } do {
_pos = getPosATL _body;
while {(count magazines _body > 0) && (time - _timer < 300)} do {
uiSleep 5;
};
};
hideBody _body;
/* PVS/PVC - Skaronator */
//No need to let everyone on the server know.
//PVCDZ_obj_HideBody = _body;
//publicVariable "PVCDZ_obj_HideBody"; // remote player
//Send to server let everyone in 100 meters of the body know its just been hidden.
_inRange = _pos nearEntities ["CAManBase",100];
{
// only send to other players
if(isPlayer _x && _x != player) then {
if ((isPlayer _x) && {_x != player}) then {
PVDZ_send = [_x,"HideBody",[_body]];
publicVariableServer "PVDZ_send";
};
} count _inRange;
uiSleep 5;
deleteVehicle _body;
true;
true
};
};