Skip to content

Commit

Permalink
Add player.setIntoVehicle
Browse files Browse the repository at this point in the history
Former-commit-id: 733d9ef
  • Loading branch information
LeonMrBonnie committed Sep 10, 2021
1 parent f4027dd commit c074740
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
14 changes: 14 additions & 0 deletions src/bindings/Player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,18 @@ static void IsEntityInStreamRange(const v8::FunctionCallbackInfo<v8::Value>& inf
V8_RETURN_BOOLEAN(player->IsEntityInStreamingRange(entity));
}

static void SetIntoVehicle(const v8::FunctionCallbackInfo<v8::Value>& info)
{
V8_GET_ISOLATE_CONTEXT();
V8_CHECK_ARGS_LEN(2);
V8_GET_THIS_BASE_OBJECT(player, IPlayer);

V8_ARG_TO_BASE_OBJECT(1, vehicle, alt::IVehicle, "Vehicle");
V8_ARG_TO_UINT32(2, seat);

player->SetIntoVehicle(vehicle, seat);
}

static void AllGetter(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Value>& info)
{
v8::Isolate* isolate = info.GetIsolate();
Expand Down Expand Up @@ -470,4 +482,6 @@ extern V8Class v8Player("Player", v8Entity, nullptr, [](v8::Local<v8::FunctionTe
V8::SetMethod(isolate, tpl, "getProp", &GetProps);
V8::SetMethod(isolate, tpl, "getDlcProp", &GetDlcProps);
V8::SetMethod(isolate, tpl, "clearProp", &ClearProps);

V8::SetMethod(isolate, tpl, "setIntoVehicle", &SetIntoVehicle);
});
2 changes: 1 addition & 1 deletion src/cpp-sdk

0 comments on commit c074740

Please sign in to comment.