1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-03-03 03:49:41 +00:00

Resurrect function

This commit is contained in:
Koncord 2016-07-12 23:26:53 +08:00
parent 1a32385632
commit 299c4c904e
3 changed files with 10 additions and 2 deletions

View file

@ -212,7 +212,6 @@ void Networking::Update(RakNet::Packet *packet)
//packetMainStats.Read(player);
player->CreatureStats()->mDead = true;
myPacket->Send(player, true);
controller->GetPacket(ID_GAME_RESURRECT)->RequestData(player->guid);
Script::Call<Script::CallbackIdentity("OnPlayerDeath")>(player->GetID());

View file

@ -406,3 +406,10 @@ void ScriptFunctions::SetCharGenStage(unsigned short pid, int start, int end) no
mwmp::Networking::Get().GetController()->GetPacket(ID_GAME_CHARGEN)->Send(player, false);
}
void ScriptFunctions::Resurrect(unsigned short pid)
{
Player *player;
GET_PLAYER(pid, player,);
mwmp::Networking::Get().GetController()->GetPacket(ID_GAME_RESURRECT)->RequestData(player->guid);
}

View file

@ -90,6 +90,7 @@ public:
static int GetIncreaseSkill(unsigned short pid, unsigned int pos) noexcept;
static void SetIncreaseSkill(unsigned short pid, unsigned int pos, int value) noexcept;
static void Resurrect(unsigned short pid);
//static void AddItem(unsigned short pid, const char* itemName, unsigned short count) noexcept;
//static void RemoveItem(unsigned short pid, const char* itemName, unsigned short count) noexcept;
@ -205,6 +206,7 @@ public:
{"HasItemEquipped", ScriptFunctions::HasItemEquipped},
{"SendMessage", ScriptFunctions::SendMessage},
{"SetCharGenStage", ScriptFunctions::SetCharGenStage},
{"Resurrect", ScriptFunctions::Resurrect},
{"Kick", ScriptFunctions::Kick},
};
@ -224,4 +226,4 @@ public:
};
};
#endif //SOURCEPAWN_SCRIPTFUNCTIONS_HPP
#endif //SOURCEPAWN_SCRIPTFUNCTIONS_HPP