A few sdktools functions now accept all entities and the Player versions are deprecated

--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%40986
This commit is contained in:
David Anderson 2007-06-18 17:02:42 +00:00
parent db5c7cdc80
commit a76f3eba97
2 changed files with 42 additions and 14 deletions

View File

@ -183,7 +183,7 @@ static cell_t IgnitePlayer(IPluginContext *pContext, const cell_t *params)
InitPass(pass[1], Valve_Bool, PassType_Basic, PASSFLAG_BYVAL);
InitPass(pass[2], Valve_Float, PassType_Float, PASSFLAG_BYVAL);
InitPass(pass[3], Valve_Bool, PassType_Basic, PASSFLAG_BYVAL);
if (!CreateBaseCall("Ignite", ValveCall_Player, NULL, pass, 4, &pCall))
if (!CreateBaseCall("Ignite", ValveCall_Entity, NULL, pass, 4, &pCall))
{
return pContext->ThrowNativeError("\"Ignite\" not supported by this mod");
} else if (!pCall) {
@ -207,7 +207,7 @@ static cell_t ExtinguishPlayer(IPluginContext *pContext, const cell_t *params)
static ValveCall *pCall = NULL;
if (!pCall)
{
if (!CreateBaseCall("Extinguish", ValveCall_Player, NULL, NULL, 0, &pCall))
if (!CreateBaseCall("Extinguish", ValveCall_Entity, NULL, NULL, 0, &pCall))
{
return pContext->ThrowNativeError("\"Extinguish\" not supported by this mod");
} else if (!pCall) {
@ -231,7 +231,7 @@ static cell_t TeleportPlayer(IPluginContext *pContext, const cell_t *params)
InitPass(pass[0], Valve_Vector, PassType_Basic, PASSFLAG_BYVAL);
InitPass(pass[1], Valve_QAngle, PassType_Basic, PASSFLAG_BYVAL);
InitPass(pass[2], Valve_Vector, PassType_Basic, PASSFLAG_BYVAL);
if (!CreateBaseCall("Teleport", ValveCall_Player, NULL, pass, 3, &pCall))
if (!CreateBaseCall("Teleport", ValveCall_Entity, NULL, pass, 3, &pCall))
{
return pContext->ThrowNativeError("\"Teleport\" not supported by this mod");
} else if (!pCall) {
@ -252,10 +252,14 @@ static cell_t TeleportPlayer(IPluginContext *pContext, const cell_t *params)
sp_nativeinfo_t g_Natives[] =
{
{"ExtinguishPlayer", ExtinguishPlayer},
{"ExtinguishEntity", ExtinguishPlayer},
{"GivePlayerItem", GiveNamedItem},
{"GetPlayerWeaponSlot", GetPlayerWeaponSlot},
{"IgnitePlayer", IgnitePlayer},
{"IgniteEntity", IgnitePlayer},
{"RemovePlayerItem", RemovePlayerItem},
{"TeleportPlayer", TeleportPlayer},
{"TeleportEntity", TeleportPlayer},
{NULL, NULL},
};

View File

@ -51,35 +51,59 @@ native GivePlayerItem(client, const String:item[], iSubType=0);
native GetPlayerWeaponSlot(client, slot);
/**
* Ignites a player on fire.
* Ignites an entity on fire.
*
* @param client Client index.
* @param entity Entity index.
* @param time Number of seconds to set on fire.
* @param npc True to only affect NPCs.
* @param size Unknown.
* @param level Unknown.
* @noreturn
* @error Invalid client or client not in game, or lack of mod support.
* @error Invalid entity or client not in game, or lack of mod support.
*/
native IgnitePlayer(client, Float:time, bool:npc=false, Float:size=0.0, bool:level=false);
native IgniteEntity(entity, Float:time, bool:npc=false, Float:size=0.0, bool:level=false);
/**
* Extinguishes a player that is on fire.
*
* @param client Client index.
* @param entity Entity index.
* @noreturn
* @error Invalid client or client not in game, or lack of mod support.
* @error Invalid entity or client not in game, or lack of mod support.
*/
native ExtinguishPlayer(client);
native ExtinguishEntity(client);
/**
* Teleports a player.
* Teleports an entity.
*
* @param client Client index.
* @param entity Client index.
* @param origin New origin, or NULL_VECTOR for no change.
* @param angles New angles, or NULL_VECTOR for no change.
* @param velocity New velocity, or NULL_VECTOR for no change.
* @noreturn
* @error Invalid client or client not in game, or lack of mod support.
* @error Invalid entity or client not in game, or lack of mod support.
*/
native TeleportPlayer(client, const Float:origin[3], const Float:angles[3], const Float:velocity[3]);
native TeleportEntity(entity, const Float:origin[3], const Float:angles[3], const Float:velocity[3]);
/**
* @deprecated
*/
stock IgnitePlayer(client, Float:time, bool:npc=false, Float:size=0.0, bool:level=false)
{
return IgniteEntity(client, time, npc, size, level);
}
/**
* @deprecated
*/
stock ExtinguishClient(client)
{
return ExtinguishEntity(client);
}
/**
* @deprecated
*/
stock TeleportPlayer(client, const Float:origin[3], const Float:angles[3], const Float:velocity[3])
{
return TeleportEntity(client, origin, angles, velocity);
}