"die" server command added
This commit is contained in:
parent
ba858f17a0
commit
73360b86cd
@ -4272,6 +4272,10 @@ void Server::SendBlocks(float dtime)
|
||||
/*
|
||||
Something random
|
||||
*/
|
||||
void Server::KillPlayer(Player *player)
|
||||
{ // to consider: in creative or if hp is disabled: just respawn, so inventory is not lost
|
||||
HandlePlayerHP(player,32767);
|
||||
}
|
||||
|
||||
void Server::HandlePlayerHP(Player *player, s16 damage)
|
||||
{
|
||||
|
@ -432,6 +432,7 @@ public:
|
||||
void BroadcastPlayerClan(u16 clan, const std::string& name); //j
|
||||
void SendClanDeleted(u16 peer_id,u16 clan); //j
|
||||
void BroadcastClanDeleted(u16 clan); //j
|
||||
void KillPlayer(Player *player); //p
|
||||
|
||||
u64 getPlayerAuthPrivs(const std::string &name)
|
||||
{
|
||||
|
@ -339,6 +339,12 @@ void cmd_clanNew(std::wostringstream &os,
|
||||
else os<< L"-!- Error - clan '"<<ctx->parms[1]<<"' NOT added.";
|
||||
}
|
||||
|
||||
void cmd_die(std::wostringstream &os,
|
||||
ServerCommandContext *ctx)
|
||||
{
|
||||
ctx->server->KillPlayer(ctx->player);
|
||||
}
|
||||
|
||||
//j
|
||||
void cmd_clanDelete(std::wostringstream &os,
|
||||
ServerCommandContext *ctx)
|
||||
@ -502,6 +508,8 @@ std::wstring processServerCommand(ServerCommandContext *ctx)
|
||||
cmd_me(os, ctx);
|
||||
else if(ctx->parms[0] == L"clearobjects")
|
||||
cmd_clearobjects(os, ctx);
|
||||
else if(ctx->parms[0] == L"die")
|
||||
cmd_die(os, ctx);
|
||||
else if(ctx->parms[0] == L"clan-new")
|
||||
{
|
||||
cmd_clanNew(os, ctx);
|
||||
|
Loading…
x
Reference in New Issue
Block a user