added a few more natives
--HG-- extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%40961
This commit is contained in:
parent
11ff381289
commit
0b9447d986
@ -173,10 +173,89 @@ static cell_t GetPlayerWeaponSlot(IPluginContext *pContext, const cell_t *params
|
||||
return engine->IndexOfEdict(pEdict);
|
||||
}
|
||||
|
||||
static cell_t IgnitePlayer(IPluginContext *pContext, const cell_t *params)
|
||||
{
|
||||
static ValveCall *pCall = NULL;
|
||||
if (!pCall)
|
||||
{
|
||||
ValvePassInfo pass[4];
|
||||
InitPass(pass[0], Valve_Float, PassType_Float, PASSFLAG_BYVAL);
|
||||
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))
|
||||
{
|
||||
return pContext->ThrowNativeError("\"Ignite\" not supported by this mod");
|
||||
} else if (!pCall) {
|
||||
return pContext->ThrowNativeError("\"Ignite\" wrapper failed to initialized");
|
||||
}
|
||||
}
|
||||
|
||||
START_CALL();
|
||||
DECODE_VALVE_PARAM(1, thisinfo, 0);
|
||||
DECODE_VALVE_PARAM(2, vparams, 0);
|
||||
DECODE_VALVE_PARAM(3, vparams, 1);
|
||||
DECODE_VALVE_PARAM(4, vparams, 2);
|
||||
DECODE_VALVE_PARAM(5, vparams, 3);
|
||||
FINISH_CALL_SIMPLE(NULL);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
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))
|
||||
{
|
||||
return pContext->ThrowNativeError("\"Extinguish\" not supported by this mod");
|
||||
} else if (!pCall) {
|
||||
return pContext->ThrowNativeError("\"Extinguish\" wrapper failed to initialized");
|
||||
}
|
||||
}
|
||||
|
||||
START_CALL();
|
||||
DECODE_VALVE_PARAM(1, thisinfo, 0);
|
||||
FINISH_CALL_SIMPLE(NULL);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static cell_t TeleportPlayer(IPluginContext *pContext, const cell_t *params)
|
||||
{
|
||||
static ValveCall *pCall = NULL;
|
||||
if (!pCall)
|
||||
{
|
||||
ValvePassInfo pass[3];
|
||||
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))
|
||||
{
|
||||
return pContext->ThrowNativeError("\"Teleport\" not supported by this mod");
|
||||
} else if (!pCall) {
|
||||
return pContext->ThrowNativeError("\"Teleport\" wrapper failed to initialized");
|
||||
}
|
||||
}
|
||||
|
||||
START_CALL();
|
||||
DECODE_VALVE_PARAM(1, thisinfo, 0);
|
||||
DECODE_VALVE_PARAM(2, vparams, 0);
|
||||
DECODE_VALVE_PARAM(3, vparams, 1);
|
||||
DECODE_VALVE_PARAM(4, vparams, 2);
|
||||
FINISH_CALL_SIMPLE(NULL);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
sp_nativeinfo_t g_Natives[] =
|
||||
{
|
||||
{"RemovePlayerItem", RemovePlayerItem},
|
||||
{"ExtinguishPlayer", ExtinguishPlayer},
|
||||
{"GivePlayerItem", GiveNamedItem},
|
||||
{"GetPlayerWeaponSlot", GetPlayerWeaponSlot},
|
||||
{"IgnitePlayer", IgnitePlayer},
|
||||
{"RemovePlayerItem", RemovePlayerItem},
|
||||
{"TeleportPlayer", TeleportPlayer},
|
||||
{NULL, NULL},
|
||||
};
|
||||
|
@ -24,6 +24,21 @@
|
||||
"windows" "224"
|
||||
"linux" "225"
|
||||
}
|
||||
"Ignite"
|
||||
{
|
||||
"windows" "188"
|
||||
"linux" "189"
|
||||
}
|
||||
"Extinguish"
|
||||
{
|
||||
"windows" "189"
|
||||
"linux" "190"
|
||||
}
|
||||
"Teleport"
|
||||
{
|
||||
"windows" "98"
|
||||
"linux" "99"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -50,6 +50,7 @@ enum SDKType
|
||||
SDKType_Float, /**< Float (any) */
|
||||
SDKType_Edict, /**< edict_t (always as pointer) */
|
||||
SDKType_String, /**< NULL-terminated string (always as pointer) */
|
||||
SDKType_Bool, /**< Boolean (any) */
|
||||
};
|
||||
|
||||
enum SDKPassMethod
|
||||
|
@ -49,3 +49,37 @@ native GivePlayerItem(client, const String:item[], iSubType=0);
|
||||
* @error Invalid client or client not in game, or lack of mod support.
|
||||
*/
|
||||
native GetPlayerWeaponSlot(client, slot);
|
||||
|
||||
/**
|
||||
* Ignites a player on fire.
|
||||
*
|
||||
* @param client Client 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.
|
||||
*/
|
||||
native IgnitePlayer(client, Float:time, bool:npc=false, Float:size=0.0, bool:level=false);
|
||||
|
||||
/**
|
||||
* Extinguishes a player that is on fire.
|
||||
*
|
||||
* @param client Client index.
|
||||
* @noreturn
|
||||
* @error Invalid client or client not in game, or lack of mod support.
|
||||
*/
|
||||
native ExtinguishPlayer(client);
|
||||
|
||||
/**
|
||||
* Teleports a player.
|
||||
*
|
||||
* @param client 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.
|
||||
*/
|
||||
native TeleportPlayer(client, const Float:origin[3], const Float:angles[3], const Float:velocity[3]);
|
||||
|
Loading…
Reference in New Issue
Block a user