Newbie Needs Help (v2.0)(RemoteExecution)

Okay here is the local diag_log
Code:
Error in expression <t.sqf";
if ( !((getPlayerUID player) in AdminList) && !((getPlayerUID player) in>
  Error position: <AdminList) && !((getPlayerUID player) in>
  Error Undefined variable in expression: adminlist
File mpmissions\__CUR_MP.Chernarus\init.sqf, line 104
Warning Message: Script z\addons\dayz_server\maps\dayz.sqf not found
"Res3tting B!S effects..."
"DAYZ: CLIENT IS RUNNING DAYZ_CODE "1.0.4.2""
"PLAYER RESULT: true"
"PLOGIN: Login loop completed!"
Error in expression <er enablesimulation false;
}
}     
_tempException = nil;
tempList = [
"_tem>
  Error position: <_tempException = nil;
tempList = [
"_tem>
  Error Missing ;
File mpmissions\__CUR_MP.Chernarus\admintools\tools\freeze.sqf, line 46
Error in expression <er enablesimulation false;
}
}     
_tempException = nil;
tempList = [
"_tem>
  Error position: <_tempException = nil;
tempList = [
"_tem>
  Error Missing ;
File mpmissions\__CUR_MP.Chernarus\admintools\tools\freeze.sqf, line 46
Item description is not an array: <null>.
- in user menu description '_pmenu', item #2: [["",true],<null>,["ITr1ckst3rI",[12],"",-5,[["expression","pselect5 = plist select 0;"]],"1","1"],["",[-1],"",-5,[["expression",""]],"1","0"],["Exit",[13],"",-5,[["expression","pselect5 = 'exit';"]],"1","1"]].

line 46
Code:
            _tempException = nil;

Thanks for your help btw, ShootingBlanks

New code including the diag_log
Code:
if (pselect5 != "exit") then
{
    _name = pselect5;
    diag_log _name;
    {
        if(name _x == _name) then
        {
            _tempException = getPlayerUID _x;
            tempList = [
                "_tempException"
            ];
     
          "Freeze" addPublicVariableEventHandler {             //creating commands to run
           _UID2 = getPlayerUID player ;                              //getting local UID from client running the script
           _UID = getPlayerUID _x;
                  diag_log _UID2;
                  diag_log UID;
            if (_UID  == _UID2)  then{
            player enablesimulation false; //do i use the semi-colon in this?
                                    }
                               }        
            _tempException = nil;
            tempList = [
                "_tempException"
            ];
        };
    } forEach entities "CAManBase";
};
 
i tested this
Code:
    {

        if(name _x == _name) then
        {
            _tempException = getPlayerUID _x;
            tempList = [
                "_tempException"
            ];
    
          "Freeze" addPublicVariableEventHandler {             //creating commands to run
           _UID2 = getPlayerUID player ;                              //getting local UID from client running the script
           _UID = getPlayerUID _x;

            if (_UID  == _UID2)  then{
            player enablesimulation false; //do i use the semi-colon in this?
                                    }
                               }       
            _tempException = nil;
            tempList = [
                "_tempException"
            ];
        };
    } forEach entities "CAManBase";
};
and nothing happened. Im going to include the diag_log here in a second.

To sum it up

1) Menu gets all players on server
2) Code gets selected players UID
3) Code runs and the local players UID is collected.
4) Code compares the two, and runs if they are equal

Makes sense, but doing it is turning out to be a pain in my ass lol

where is _name defined? its a local variable. I wrote a code last week and it did not work until I put the eventhandler in the init.sqf file

from the wiki https://community.bistudio.com/wiki/6thSense.eu:EG it says in the init.sqf and thats how it has worked best for me.
Code:
PublicVariableEventHandler Demo

init.sqf:
  "T_myPvEh" addPublicVariableEventHandler
  {
    private ["_variable", "_value", "_msg"];
    _variable = _this select 0;
    _value = _this select 1;
    _msg = format["Variable: %1, Value: %2", _variable, _value];
    localize _msg; // Write to arma.rpt
    (_value select 0) globalChat format["Variable: %1, Value: %2", _variable, _value];
  };
  sleep 10;
  T_myPvEh = [player, "HELLO"];
  publicVariable "T_myPvEh"; // This data will only be received on other machines. Not on the machine where it is executed.


the code looks like its at least close to working. Is your menu calling the function? Is your menu working?
 
Your _tempexception error is trying to undefine the variable. and then you are going to include an undefined variable in an array.
I would try this instead:
_tempvariable = "";
templist = [];
 
That was only the code snippet where I changed it. The rest is the same from the pastebin.

I'll try the init.sqf way and see what that does.

ill also change the templist too.
 
okay the init file method didn't seem to work either.

BOTTOM of init located in missions pbo root
Code:
//...some code....

"Freeze" addPublicVariableEventHandler {
 _UID2 = getPlayerUID player ;
 _UID = getPlayerUID _x;
 if (_UID  == _UID2)  then{
            player enablesimulation false;
                                    }
                               }

code within freeze.sqf

Code:
//AlPMaker
_max = 10; snext = false; plist = []; pselect5 = "";
{if ((getPlayerUID _x != "")) then {plist set [count plist, name _x];};} forEach entities "CAManBase";
{if ((count crew _x) > 0) then {{if ((_x != player) && (getPlayerUID _x != "")) then {plist set [count plist, name _x];};} forEach crew _x;};} foreach (entities "LandVehicle" + entities "Air" + entities "Ship");
smenu =
{
    _pmenu = [["",true]];
    for "_i" from (_this select 0) to (_this select 1) do
    {_arr = [format['%1', plist select (_i)], [12],  "", -5, [["expression", format ["pselect5 = plist select %1;", _i]]], "1", "1"]; _pmenu set [_i + 2, _arr];};
    if (count plist > (_this select 1)) then {_pmenu set [(_this select 1) + 2, ["Next", [13], "", -5, [["expression", "snext = true;"]], "1", "1"]];}
    else {_pmenu set [(_this select 1) + 2, ["", [-1], "", -5, [["expression", ""]], "1", "0"]];};
    _pmenu set [(_this select 1) + 3, ["Exit", [13], "", -5, [["expression", "pselect5 = 'exit';"]], "1", "1"]];
    showCommandingMenu "#USER:_pmenu";
};
_j = 0; _max = 10; if (_max>9) then {_max = 10;};
while {pselect5 == ""} do
{
    [_j, (_j + _max) min (count plist)] call smenu; _j = _j + _max;
    WaitUntil {pselect5 != "" or snext};   
    snext = false;
};

tempList = nil;

if (pselect5 != "exit") then
{
    _name = pselect5;
    diag_log _name;
    {
        if(name _x == _name) then
        {
            _tempException = getPlayerUID _x;
            tempList = [
                "_tempException"
            ];
     
      Freeze = newvalue;
      publicvariable "Freeze";

     
            _tempException = nil;
            tempList = [
                "_tempException"
            ];
        };
    } forEach entities "CAManBase";
};
 
i think you need to step away for a while and then look at it fresh or start from scratch. it looks like its getting all jumbled.

the init.sqf code
Code:
"Freeze" addPublicVariableEventHandler {
_UID2 = getPlayerUID player ;
_UID = getPlayerUID _x;
if (_UID  == _UID2)  then{
            player enablesimulation false;
                                    }
                               }
_x is not available as you have removed the foreach loop therefor _uid is invalid.
the freeze.sqf file is only going to display the menu and then make the variable public.
Then the above code will run. So you need to have the uid test use the targets uid which is passed to the script in the freeze variable.
 
Back
Top