Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

onesync: add CClearPedTasksEvent server event #491

Merged
merged 2 commits into from Jul 14, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
19 changes: 19 additions & 0 deletions code/components/citizen-server-impl/src/state/ServerGameState.cpp
Expand Up @@ -3244,6 +3244,24 @@ struct CVehicleComponentControlEvent
MSGPACK_DEFINE_MAP(vehicleGlobalId, pedGlobalId, componentIndex, request, componentIsSeat, pedInSeat);
};

struct CClearPedTasksEvent
{
void Parse(rl::MessageBuffer& buffer)
{
pedId = buffer.Read<uint16_t>(13);
immediately = buffer.Read<uint8_t>(1);
}

inline std::string GetName()
{
return "clearPedTasksEvent";
}

int pedId;
bool immediately;

MSGPACK_DEFINE_MAP(pedId, immediately);
};

struct CRespawnPlayerPedEvent
{
Expand Down Expand Up @@ -3459,6 +3477,7 @@ static std::function<bool()> GetEventHandler(fx::ServerInstanceBase* instance, c
case VEHICLE_COMPONENT_CONTROL_EVENT: return GetHandler<CVehicleComponentControlEvent>(instance, client, std::move(buffer));
case FIRE_EVENT: return GetHandler<CFireEvent>(instance, client, std::move(buffer));
case EXPLOSION_EVENT: return GetHandler<CExplosionEvent>(instance, client, std::move(buffer));
case NETWORK_CLEAR_PED_TASKS_EVENT: return GetHandler<CClearPedTasksEvent>(instance, client, std::move(buffer));
};

return {};
Expand Down