added amb444 - ForcePlayerSuicide()

--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%401157
This commit is contained in:
David Anderson 2007-07-23 21:01:58 +00:00
parent 30b475ef35
commit a57acce746
3 changed files with 60 additions and 0 deletions

View File

@ -274,6 +274,26 @@ static cell_t TeleportPlayer(IPluginContext *pContext, const cell_t *params)
return 1;
}
static cell_t ForcePlayerSuicide(IPluginContext *pContext, const cell_t *params)
{
static ValveCall *pCall = NULL;
if (!pCall)
{
if (!CreateBaseCall("CommitSuicide", ValveCall_Player, NULL, NULL, 0, &pCall))
{
return pContext->ThrowNativeError("\"CommitSuicide\" not supported by this mod");
} else if (!pCall) {
return pContext->ThrowNativeError("\"CommitSuicide\" wrapper failed to initialized");
}
}
START_CALL();
DECODE_VALVE_PARAM(1, thisinfo, 0);
FINISH_CALL_SIMPLE(NULL);
return 1;
}
static cell_t SetClientViewEntity(IPluginContext *pContext, const cell_t *params)
{
IGamePlayer *player = playerhelpers->GetGamePlayer(params[1]);
@ -301,6 +321,7 @@ sp_nativeinfo_t g_Natives[] =
{
{"ExtinguishPlayer", ExtinguishPlayer},
{"ExtinguishEntity", ExtinguishPlayer},
{"ForcePlayerSuicide", ForcePlayerSuicide},
{"GivePlayerItem", GiveNamedItem},
{"GetPlayerWeaponSlot", GetPlayerWeaponSlot},
{"IgnitePlayer", IgnitePlayer},

View File

@ -134,6 +134,11 @@
"windows" "98"
"linux" "99"
}
"CommitSuicide"
{
"windows" "357"
"linux" "358"
}
}
}
@ -172,6 +177,11 @@
"windows" "98"
"linux" "99"
}
"CommitSuicide"
{
"windows" "356"
"linux" "357"
}
}
}
@ -210,6 +220,11 @@
"windows" "97"
"linux" "98"
}
"CommitSuicide"
{
"windows" "356"
"linux" "357"
}
}
}
@ -249,6 +264,11 @@
"windows" "100"
"linux" "101"
}
"CommitSuicide"
{
"windows" "343"
"linux" "344"
}
/* Temp Entities */
"TE_GetServerClass"
@ -296,6 +316,11 @@
"windows" "100"
"linux" "101"
}
"CommitSuicide"
{
"windows" "360"
"linux" "361"
}
/* Offset into CBaseTempEntity constructor.
* On Windows Dsytopia is heavily inlined; we use the function
@ -399,6 +424,11 @@
"windows" "98"
"linux" "99"
}
"CommitSuicide"
{
"windows" "356"
"linux" "357"
}
/* Temp Entities */
"s_pTempEntities"

View File

@ -84,6 +84,15 @@ native ExtinguishEntity(client);
*/
native TeleportEntity(entity, const Float:origin[3], const Float:angles[3], const Float:velocity[3]);
/**
* Forces a player to commit suicide.
*
* @param client Client index.
* @noreturn
* @error Invalid entity or client not in game, or lack of mod support.
*/
native ForcePlayerSuicide(client);
/**
* @deprecated
*/