#include <amxmodx>
#include <fakemeta>
#define PLUGIN "Short Pallet"
#define VERSION "1.2"
#define AUTHOR "www.effexo.net"
new const g_szPalletModel[] = "models/pallet.mdl"
public plugin_precache() {
register_plugin(PLUGIN, VERSION, AUTHOR)
new szMapName[9]
get_mapname(szMapName, charsmax(szMapName))
if(equal(szMapName, "de_dust2")) {
precache_model(g_szPalletModel)
createPalletCtShort();
createPalletMidShort_1();
createPalletMidShort_2();
}
}
public createPalletCtShort() {
new const Float: fPalletOrigin[3] = {578.0, 2367.0, 74.0};
new const Float: fPalletAngle[3] = {0.0, 90.0, 45.0};
new const Float: fMins[3] = {-30.0, -23.0, -25.0}
new const Float: fMaxs[3] = {10.0, 20.0, 6.0}
createPalletEntity(fPalletOrigin, fPalletAngle, fMins, fMaxs);
}
public createPalletMidShort_1() {
new const Float: fPalletOrigin[3] = {-287.0, 1359.0, -94.0};
new const Float: fPalletAngle[3] = {60.0, 0.0, 0.0};
new const Float: fMins[3] = {0.0, -25.0, -32.0}
new const Float: fMaxs[3] = {28.0, 17.0, 10.0}
createPalletEntity(fPalletOrigin, fPalletAngle, fMins, fMaxs);
}
public createPalletMidShort_2() {
new const Float: fPalletOrigin[3] = {-287.0, 1445.0, 3.0};
new const Float: fPalletAngle[3] = {40.0, 0.0, 0.0};
new const Float: fMins[3] = {0.0, -26.0, -35.0}
new const Float: fMaxs[3] = {30.0, 25.0, 0.0}
createPalletEntity(fPalletOrigin, fPalletAngle, fMins, fMaxs);
}
createPalletEntity(const Float: fOrigin[3], const Float: fAngle[3], const Float: fMins[3], const Float: fMaxs[3]) {
new iPalletEntityIndex = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "info_target"));
if(!pev_valid(iPalletEntityIndex))
return
engfunc(EngFunc_SetOrigin, iPalletEntityIndex, fOrigin)
engfunc(EngFunc_SetModel, iPalletEntityIndex, g_szPalletModel)
set_pev(iPalletEntityIndex, pev_classname, "short_pallet"); // exclude from the def ents
set_pev(iPalletEntityIndex, pev_solid, SOLID_BBOX)
set_pev(iPalletEntityIndex, pev_angles, fAngle)
engfunc(EngFunc_SetSize, iPalletEntityIndex, fMins, fMaxs)
}