Jump to content
khalcifer

Vehicle on KoH not spawn

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;

Share this post


Link to post
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.

Share this post


Link to post
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:(

Share this post


Link to post
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.

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

  • Advertisement
  • Supporters
  • Discord

×
×
  • Create New...