Skip to content

Commit e17fad5

Browse files
committed
Player: Added forceSpawn method
1 parent 70d5553 commit e17fad5

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

VCMP-LUA/vcmpWrap/Classes/Player.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,11 @@ bool Player::isPlayerStreamed(Player* player) const {
7272
return false;
7373
}
7474

75+
void Player::forceSpawn() const
76+
{
77+
g_Funcs->ForcePlayerSpawn(m_ID);
78+
}
79+
7580
void Player::playSound(int32_t sound) const
7681
{
7782
g_Funcs->PlaySound(getWorld(), sound, NAN, NAN, NAN);
@@ -487,6 +492,7 @@ void Player::Init(sol::state* L) {
487492
userdata["getOption"] = &Player::getOption;
488493
userdata["setOption"] = &Player::setOption;
489494
userdata["isPlayerStreamed"] = &Player::isPlayerStreamed;
495+
userdata["forceSpawn"] = &Player::forceSpawn;
490496
userdata["playSound"] = &Player::playSound;
491497
userdata["playSound3D"] = sol::overload(&Player::playSound3D, &Player::playSound3DEx, &Player::playSound3DEx2);
492498
userdata["setWeapom"] = &Player::setWeapon;

VCMP-LUA/vcmpWrap/Classes/Player.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ class Player {
3030
bool getOption(vcmpPlayerOption) const;
3131
void setOption(vcmpPlayerOption, bool);
3232
bool isPlayerStreamed(Player*) const;
33+
void forceSpawn() const;
3334
void playSound(int32_t) const;
3435
void playSound3D(int32_t) const; // Player's position
3536
void playSound3DEx(int32_t, sol::table) const;

0 commit comments

Comments
 (0)