1.1 --- a/core/smn_halflife.cpp Sun Mar 25 21:18:50 2007 +0000
1.2 +++ b/core/smn_halflife.cpp Sun Mar 25 22:25:45 2007 +0000
1.3 @@ -135,6 +135,78 @@
1.4 return bytes;
1.5 }
1.6
1.7 +static cell_t PrecacheModel(IPluginContext *pContext, const cell_t *params)
1.8 +{
1.9 + char *model;
1.10 + pContext->LocalToString(params[1], &model);
1.11 +
1.12 + return engine->PrecacheModel(model, params[2] ? true : false);
1.13 +}
1.14 +
1.15 +static cell_t PrecacheSentenceFile(IPluginContext *pContext, const cell_t *params)
1.16 +{
1.17 + char *sentencefile;
1.18 + pContext->LocalToString(params[1], &sentencefile);
1.19 +
1.20 + return engine->PrecacheSentenceFile(sentencefile, params[2] ? true : false);
1.21 +}
1.22 +
1.23 +static cell_t PrecacheDecal(IPluginContext *pContext, const cell_t *params)
1.24 +{
1.25 + char *decal;
1.26 + pContext->LocalToString(params[1], &decal);
1.27 +
1.28 + return engine->PrecacheDecal(decal, params[2] ? true : false);
1.29 +}
1.30 +
1.31 +static cell_t PrecacheGeneric(IPluginContext *pContext, const cell_t *params)
1.32 +{
1.33 + char *generic;
1.34 + pContext->LocalToString(params[1], &generic);
1.35 +
1.36 + return engine->PrecacheGeneric(generic, params[2] ? true : false);
1.37 +}
1.38 +
1.39 +static cell_t IsModelPrecached(IPluginContext *pContext, const cell_t *params)
1.40 +{
1.41 + char *model;
1.42 + pContext->LocalToString(params[1], &model);
1.43 +
1.44 + return engine->IsModelPrecached(model) ? 1 : 0;
1.45 +}
1.46 +
1.47 +static cell_t IsDecalPrecached(IPluginContext *pContext, const cell_t *params)
1.48 +{
1.49 + char *decal;
1.50 + pContext->LocalToString(params[1], &decal);
1.51 +
1.52 + return engine->IsDecalPrecached(decal) ? 1 : 0;
1.53 +}
1.54 +
1.55 +static cell_t IsGenericPrecached(IPluginContext *pContext, const cell_t *params)
1.56 +{
1.57 + char *generic;
1.58 + pContext->LocalToString(params[1], &generic);
1.59 +
1.60 + return engine->IsGenericPrecached(generic) ? 1 : 0;
1.61 +}
1.62 +
1.63 +static cell_t PrecacheSound(IPluginContext *pContext, const cell_t *params)
1.64 +{
1.65 + char *sample;
1.66 + pContext->LocalToString(params[1], &sample);
1.67 +
1.68 + return enginesound->PrecacheSound(sample, params[2] ? true : false) ? 1 : 0;
1.69 +}
1.70 +
1.71 +static cell_t IsSoundPrecached(IPluginContext *pContext, const cell_t *params)
1.72 +{
1.73 + char *sample;
1.74 + pContext->LocalToString(params[1], &sample);
1.75 +
1.76 + return enginesound->IsSoundPrecached(sample) ? 1 : 0;
1.77 +}
1.78 +
1.79 REGISTER_NATIVES(halflifeNatives)
1.80 {
1.81 {"CreateFakeClient", CreateFakeClient},
1.82 @@ -148,5 +220,14 @@
1.83 {"IsMapValid", IsMapValid},
1.84 {"SetFakeClientConVar", SetFakeClientConVar},
1.85 {"SetRandomSeed", SetRandomSeed},
1.86 + {"PrecacheModel", PrecacheModel},
1.87 + {"PrecacheSentenceFile", PrecacheSentenceFile},
1.88 + {"PrecacheDecal", PrecacheDecal},
1.89 + {"PrecacheGeneric", PrecacheGeneric},
1.90 + {"IsModelPrecached", IsModelPrecached},
1.91 + {"IsDecalPrecached", IsDecalPrecached},
1.92 + {"IsGenericPrecached", IsGenericPrecached},
1.93 + {"PrecacheSound", PrecacheSound},
1.94 + {"IsSoundPrecached", IsSoundPrecached},
1.95 {NULL, NULL},
1.96 };