Jump to content

Vehicle on KoH not spawn


khalcifer

Recommended Posts

Hello any one can help me??

The arrow appears but the vehicle no longer. I cant share more because this is private script

RPT error

13:16:17 Error in expression <lientKey = _this select 5;
_playerUID = getPlayerUID _activatingPlayer;

_exitRe>
13:16:17   Error position: <getPlayerUID _activatingPlayer;

_exitRe>
13:16:17   Error getplayeruid: Type String, expected Object
13:16:17 File z\addons\dayz_server\compile\server_publishVehicle2.sqf, line 12

 

in fnc_createvehicle.sqf

_veh = createVehicle ["Sign_arrow_down_large_EP1", [((_pos select 0) - 5), ((_pos select 1) + 5),(_pos select 2)], [], 0, "CAN_COLLIDE"];
    _location = (getPosATL _veh);
    _nearPlayers = _veh nearEntities ["Man",1000];
    [_veh,[(round(random 360)),_location],_vehClass,false,_keySelected,(_nearPlayers select 0)] call server_publishVeh2;

Link to comment
Share on other sites

5 hours ago, khalcifer said:

Hello any one can help me??

The arrow appears but the vehicle no longer. I cant share more because this is private script

RPT error

13:16:17 Error in expression <lientKey = _this select 5;
_playerUID = getPlayerUID _activatingPlayer;

_exitRe>
13:16:17   Error position: <getPlayerUID _activatingPlayer;

_exitRe>
13:16:17   Error getplayeruid: Type String, expected Object
13:16:17 File z\addons\dayz_server\compile\server_publishVehicle2.sqf, line 12

 

in fnc_createvehicle.sqf

_veh = createVehicle ["Sign_arrow_down_large_EP1", [((_pos select 0) - 5), ((_pos select 1) + 5),(_pos select 2)], [], 0, "CAN_COLLIDE"];
    _location = (getPosATL _veh);
    _nearPlayers = _veh nearEntities ["Man",1000];
    [_veh,[(round(random 360)),_location],_vehClass,false,_keySelected,(_nearPlayers select 0)] call server_publishVeh2;

Your fnc_createvehicle.sqf is out of date, we now have authentication for vehicle creation.

[[_dir,_location],_vehClass,false,_keySelected,_nearPlayers select 0,dayz_authKey] call server_publishVeh2;

Something like this may work instead but it's hard to see without testing/seeing your code.

 

*edit* This definitely won't work as dayz_authKey will not be present on the server.

Link to comment
Share on other sites

17 hours ago, salival said:

[[_dir,_location],_vehClass,false,_keySelected,_nearPlayers select 0,dayz_authKey] call server_publishVeh2;

Something like this may work instead but it's hard to see without testing/seeing your code.

 

*edit* This definitely won't work as dayz_authKey will not be present on the server.

yes its not working:(

Link to comment
Share on other sites

What does this private script actually do? You don't have to post the code, just tell us what it does. Otherwise, there is no way to give you advice.

As you can see from this error, function server_publishVeh2 requires that you pass the player object, not the player UID string.

13:16:17   Error getplayeruid: Type String, expected Object

As Salival posted above, in order to use this function you have to pass an array from the client with a public variable. A way around this would be to write your own vehicle publisher that doesn't have those requirements and can be accessed via a server-side script like WAI does.

Link to comment
Share on other sites

3 hours ago, JasonTM said:

What does this private script actually do? You don't have to post the code, just tell us what it does. Otherwise, there is no way to give you advice.

As you can see from this error, function server_publishVeh2 requires that you pass the player object, not the player UID string.


13:16:17   Error getplayeruid: Type String, expected Object

As Salival posted above, in order to use this function you have to pass an array from the client with a public variable. A way around this would be to write your own vehicle publisher that doesn't have those requirements and can be accessed via a server-side script like WAI does.

Nevermind i have fixed it. Btw this is King of the hill mission.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
  • Discord

×
×
  • Create New...