Skip to content

Commit d092f09

Browse files
committed
NPC_IsMoving, NPC_EnterVehicle, NPC_ExitVehicle
1 parent d035b35 commit d092f09

File tree

4 files changed

+25
-1
lines changed

4 files changed

+25
-1
lines changed

SDK

Server/Components/NPCs/NPC/npc.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,11 @@ void NPC::stopMove()
269269
footSync_.UpDown = 0;
270270
}
271271

272+
bool NPC::isMoving() const
273+
{
274+
return moving_;
275+
}
276+
272277
void NPC::setSkin(int model)
273278
{
274279
player_->setSkin(model);

Server/Components/NPCs/NPC/npc.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ class NPC : public INPC, public PoolIDProvider, public NoCopy
3737

3838
void stopMove() override;
3939

40+
bool isMoving() const override;
41+
4042
void setSkin(int model) override;
4143

4244
bool isStreamedInForPlayer(const IPlayer& other) const override;

Server/Components/Pawn/Scripting/NPC/Natives.cpp

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,11 @@ SCRIPT_API(NPC_StopMove, bool(INPC& npc))
103103
return true;
104104
}
105105

106+
SCRIPT_API(NPC_IsMoving, bool(INPC& npc))
107+
{
108+
return npc.isMoving();
109+
}
110+
106111
SCRIPT_API(NPC_SetSkin, bool(INPC& npc, int model))
107112
{
108113
npc.setSkin(model);
@@ -357,3 +362,15 @@ SCRIPT_API(NPC_GetWeaponAccuracy, float(INPC& npc, int weapon))
357362
{
358363
return npc.getWeaponAccuracy(weapon);
359364
}
365+
366+
SCRIPT_API(NPC_EnterVehicle, bool(INPC& npc, IVehicle& vehicle, int seatId, int moveType))
367+
{
368+
npc.enterVehicle(vehicle, seatId, NPCMoveType(moveType));
369+
return true;
370+
}
371+
372+
SCRIPT_API(NPC_ExitVehicle, bool(INPC& npc))
373+
{
374+
npc.exitVehicle();
375+
return true;
376+
}

0 commit comments

Comments
 (0)