A few sdktools functions now accept all entities and the Player versions are deprecated
A few sdktools functions now accept all entities and the Player versions are deprecated
1.1 --- a/extensions/sdktools/vnatives.cpp Mon Jun 18 07:09:47 2007 +0000
1.2 +++ b/extensions/sdktools/vnatives.cpp Mon Jun 18 17:02:42 2007 +0000
1.3 @@ -183,7 +183,7 @@
1.4 InitPass(pass[1], Valve_Bool, PassType_Basic, PASSFLAG_BYVAL);
1.5 InitPass(pass[2], Valve_Float, PassType_Float, PASSFLAG_BYVAL);
1.6 InitPass(pass[3], Valve_Bool, PassType_Basic, PASSFLAG_BYVAL);
1.7 - if (!CreateBaseCall("Ignite", ValveCall_Player, NULL, pass, 4, &pCall))
1.8 + if (!CreateBaseCall("Ignite", ValveCall_Entity, NULL, pass, 4, &pCall))
1.9 {
1.10 return pContext->ThrowNativeError("\"Ignite\" not supported by this mod");
1.11 } else if (!pCall) {
1.12 @@ -207,7 +207,7 @@
1.13 static ValveCall *pCall = NULL;
1.14 if (!pCall)
1.15 {
1.16 - if (!CreateBaseCall("Extinguish", ValveCall_Player, NULL, NULL, 0, &pCall))
1.17 + if (!CreateBaseCall("Extinguish", ValveCall_Entity, NULL, NULL, 0, &pCall))
1.18 {
1.19 return pContext->ThrowNativeError("\"Extinguish\" not supported by this mod");
1.20 } else if (!pCall) {
1.21 @@ -231,7 +231,7 @@
1.22 InitPass(pass[0], Valve_Vector, PassType_Basic, PASSFLAG_BYVAL);
1.23 InitPass(pass[1], Valve_QAngle, PassType_Basic, PASSFLAG_BYVAL);
1.24 InitPass(pass[2], Valve_Vector, PassType_Basic, PASSFLAG_BYVAL);
1.25 - if (!CreateBaseCall("Teleport", ValveCall_Player, NULL, pass, 3, &pCall))
1.26 + if (!CreateBaseCall("Teleport", ValveCall_Entity, NULL, pass, 3, &pCall))
1.27 {
1.28 return pContext->ThrowNativeError("\"Teleport\" not supported by this mod");
1.29 } else if (!pCall) {
1.30 @@ -252,10 +252,14 @@
1.31 sp_nativeinfo_t g_Natives[] =
1.32 {
1.33 {"ExtinguishPlayer", ExtinguishPlayer},
1.34 + {"ExtinguishEntity", ExtinguishPlayer},
1.35 {"GivePlayerItem", GiveNamedItem},
1.36 {"GetPlayerWeaponSlot", GetPlayerWeaponSlot},
1.37 {"IgnitePlayer", IgnitePlayer},
1.38 + {"IgniteEntity", IgnitePlayer},
1.39 {"RemovePlayerItem", RemovePlayerItem},
1.40 {"TeleportPlayer", TeleportPlayer},
1.41 + {"TeleportEntity", TeleportPlayer},
1.42 {NULL, NULL},
1.43 };
1.44 +
2.1 --- a/plugins/include/sdktools_functions.inc Mon Jun 18 07:09:47 2007 +0000
2.2 +++ b/plugins/include/sdktools_functions.inc Mon Jun 18 17:02:42 2007 +0000
2.3 @@ -51,35 +51,59 @@
2.4 native GetPlayerWeaponSlot(client, slot);
2.5
2.6 /**
2.7 - * Ignites a player on fire.
2.8 + * Ignites an entity on fire.
2.9 *
2.10 - * @param client Client index.
2.11 + * @param entity Entity index.
2.12 * @param time Number of seconds to set on fire.
2.13 * @param npc True to only affect NPCs.
2.14 * @param size Unknown.
2.15 * @param level Unknown.
2.16 * @noreturn
2.17 - * @error Invalid client or client not in game, or lack of mod support.
2.18 + * @error Invalid entity or client not in game, or lack of mod support.
2.19 */
2.20 -native IgnitePlayer(client, Float:time, bool:npc=false, Float:size=0.0, bool:level=false);
2.21 +native IgniteEntity(entity, Float:time, bool:npc=false, Float:size=0.0, bool:level=false);
2.22
2.23 /**
2.24 * Extinguishes a player that is on fire.
2.25 *
2.26 - * @param client Client index.
2.27 + * @param entity Entity index.
2.28 * @noreturn
2.29 - * @error Invalid client or client not in game, or lack of mod support.
2.30 + * @error Invalid entity or client not in game, or lack of mod support.
2.31 */
2.32 -native ExtinguishPlayer(client);
2.33 +native ExtinguishEntity(client);
2.34
2.35 /**
2.36 - * Teleports a player.
2.37 + * Teleports an entity.
2.38 *
2.39 - * @param client Client index.
2.40 + * @param entity Client index.
2.41 * @param origin New origin, or NULL_VECTOR for no change.
2.42 * @param angles New angles, or NULL_VECTOR for no change.
2.43 * @param velocity New velocity, or NULL_VECTOR for no change.
2.44 * @noreturn
2.45 - * @error Invalid client or client not in game, or lack of mod support.
2.46 + * @error Invalid entity or client not in game, or lack of mod support.
2.47 + */
2.48 +native TeleportEntity(entity, const Float:origin[3], const Float:angles[3], const Float:velocity[3]);
2.49 +
2.50 +/**
2.51 + * @deprecated
2.52 */
2.53 -native TeleportPlayer(client, const Float:origin[3], const Float:angles[3], const Float:velocity[3]);
2.54 +stock IgnitePlayer(client, Float:time, bool:npc=false, Float:size=0.0, bool:level=false)
2.55 +{
2.56 + return IgniteEntity(client, time, npc, size, level);
2.57 +}
2.58 +
2.59 +/**
2.60 + * @deprecated
2.61 + */
2.62 +stock ExtinguishClient(client)
2.63 +{
2.64 + return ExtinguishEntity(client);
2.65 +}
2.66 +
2.67 +/**
2.68 + * @deprecated
2.69 + */
2.70 +stock TeleportPlayer(client, const Float:origin[3], const Float:angles[3], const Float:velocity[3])
2.71 +{
2.72 + return TeleportEntity(client, origin, angles, velocity);
2.73 +}