Skip to content

Commit

Permalink
server: add givePedScriptedTask
Browse files Browse the repository at this point in the history
  • Loading branch information
C0kkie committed Sep 17, 2023
1 parent a1f0a4e commit 6913570
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
13 changes: 13 additions & 0 deletions server/src/events/Main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include "cpp-sdk/events/CMetaDataChangeEvent.h"
#include "cpp-sdk/events/CClientDeleteObjectEvent.h"
#include "cpp-sdk/events/CClientRequestObjectEvent.h"
#include "cpp-sdk/events/CGivePedScriptedTaskEvent.h"

using alt::CEvent;
using EventType = CEvent::Type;
Expand Down Expand Up @@ -253,3 +254,15 @@ V8_LOCAL_EVENT_HANDLER clientRequestObject(EventType::CLIENT_REQUEST_OBJECT_EVEN
args.push_back(V8Helpers::JSValue(ev->GetModel()));
args.push_back(resource->CreateVector3(ev->GetPosition()));
});

V8_LOCAL_EVENT_HANDLER givePedScriptedTask(EventType::GIVE_PED_SCRIPTED_TASK,
"givePedScriptedTask",
[](V8ResourceImpl* resource, const CEvent* e, std::vector<v8::Local<v8::Value>>& args)
{
auto ev = static_cast<const alt::CGivePedScriptedTaskEvent*>(e);
v8::Isolate* isolate = resource->GetIsolate();

args.push_back(resource->GetBaseObjectOrNull(ev->GetSource()));
args.push_back(resource->GetBaseObjectOrNull(ev->GetTarget()));
args.push_back(V8Helpers::JSValue(ev->GetTaskType()));
});
2 changes: 1 addition & 1 deletion shared/deps/cpp-sdk

0 comments on commit 6913570

Please sign in to comment.