added SetEntityModel native

--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%401726
This commit is contained in:
Borja Ferrer 2007-11-24 18:17:00 +00:00
parent 5849a0d2e2
commit ef8db35a49
4 changed files with 84 additions and 0 deletions

View File

@ -802,6 +802,29 @@ static cell_t sm_GetClientAimTarget(IPluginContext *pContext, const cell_t *para
return GetClientAimTarget(pPlayer->GetEdict(), params[2] ? true : false);
}
static cell_t sm_SetEntityModel(IPluginContext *pContext, const cell_t *params)
{
static ValveCall *pCall = NULL;
if (!pCall)
{
ValvePassInfo pass[1];
InitPass(pass[0], Valve_String, PassType_Basic, PASSFLAG_BYVAL);
if (!CreateBaseCall("SetEntityModel", ValveCall_Entity, NULL, pass, 1, &pCall))
{
return pContext->ThrowNativeError("\"SetEntityModel\" not supported by this mod");
} else if (!pCall) {
return pContext->ThrowNativeError("\"SetEntityModel\" wrapper failed to initialized");
}
}
START_CALL();
DECODE_VALVE_PARAM(1, thisinfo, 0);
DECODE_VALVE_PARAM(2, vparams, 0);
FINISH_CALL_SIMPLE(NULL);
return 1;
}
sp_nativeinfo_t g_Natives[] =
{
{"ExtinguishPlayer", ExtinguishEntity},
@ -826,5 +849,6 @@ sp_nativeinfo_t g_Natives[] =
{"DispatchKeyValueFloat", DispatchKeyValueFloat},
{"DispatchKeyValueVector", DispatchKeyValueVector},
{"GetClientAimTarget", sm_GetClientAimTarget},
{"SetEntityModel", sm_SetEntityModel},
{NULL, NULL},
};

View File

@ -203,6 +203,11 @@
"windows" "27"
"linux" "30"
}
"SetEntityModel"
{
"windows" "23"
"linux" "24"
}
/**
* THESE ARE DISABLED FOR NOW.

View File

@ -326,6 +326,11 @@
"windows" "29"
"linux" "32"
}
"SetEntityModel"
{
"windows" "25"
"linux" "26"
}
}
}
@ -399,6 +404,11 @@
"windows" "29"
"linux" "32"
}
"SetEntityModel"
{
"windows" "25"
"linux" "26"
}
}
}
@ -472,6 +482,11 @@
"windows" "29"
"linux" "32"
}
"SetEntityModel"
{
"windows" "25"
"linux" "26"
}
}
}
@ -546,6 +561,11 @@
"windows" "39"
"linux" "40"
}
"SetEntityModel"
{
"windows" "30"
"linux" "31"
}
/* Temp Entities */
"TE_GetServerClass"
@ -628,6 +648,11 @@
"windows" "29"
"linux" "32"
}
"SetEntityModel"
{
"windows" "25"
"linux" "26"
}
/* Offset into CBaseTempEntity constructor.
* On Windows Dsytopia is heavily inlined; we use the function
@ -719,6 +744,11 @@
"windows" "28"
"linux" "31"
}
"SetEntityModel"
{
"windows" "24"
"linux" "25"
}
}
}
@ -813,6 +843,11 @@
"windows" "29"
"linux" "32"
}
"SetEntityModel"
{
"windows" "25"
"linux" "26"
}
/* Temp Entities */
"s_pTempEntities"
@ -888,6 +923,11 @@
"windows" "34"
"linux" "35"
}
"SetEntityModel"
{
"windows" "25"
"linux" "26"
}
/* Temp Entities */
"s_pTempEntities"
@ -981,6 +1021,11 @@
"windows" "33"
"linux" "36"
}
"SetEntityModel"
{
"windows" "27"
"linux" "28"
}
}
}
}

View File

@ -254,6 +254,16 @@ native SetTeamScore(index, value);
*/
native GetTeamClientCount(index);
/**
* Sets the model to a given entity.
*
* @param entity Entity index.
* @param model Model name.
* @noreturn
* @error Invalid entity index, or no mod support.
*/
native SetEntityModel(entity, const String:model[]);
/**
* @deprecated
*/