Compiles fine, but it do not set the player model.
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <engine>
#include <fakemeta>
#include <dodx>
new AUTHOR[] = "Rirre"
new PLUGIN_NAME[] = "DoD Custom Player Models"
new VERSION[] = "0.1b"
#define MODELS 4
new models[MODELS][128] =
{
"models/player/test/test.mdl",
"models/player/test/testT.mdl",
"models/player/coats/coats.mdl",
"models/player/coats/coatsT.mdl"
}
new models_type[2][32] =
{
"test",
"coats"
}
new body_number[33] = { 0, ...}
public plugin_init()
{
// Register this plugin
register_plugin(PLUGIN_NAME, VERSION, AUTHOR)
// Register the Forwards
register_forward(FM_PrecacheModel, "fw_precache")
register_forward(FM_PrecacheSound, "fw_precache")
register_forward(FM_PrecacheGeneric, "fw_precache")
}
public plugin_precache()
{
for(new x = 0; x < MODELS; x++)
{
if(!file_exists(models[x]))
{
log_amx("File: %s Does not Exist!", models[x])
return PLUGIN_CONTINUE
}
precache_model(models[x])
enforce(models[x])
}
precache_model("models/rpgrocket.mdl")
return PLUGIN_CONTINUE
}
public client_putinserver(id)
{
if(!is_user_connected(id))
body_number[id] = 12
return PLUGIN_CONTINUE
}
public dod_client_changeteam(id, team, oldteam)
{
if(!is_user_connected(id))
{
if(team == ALLIES || team == AXIS)
dod_set_model(id, models_type[team-1])
}
return PLUGIN_CONTINUE
}
public dod_client_changeclass(id, class, oldclass)
{
if(!is_user_connected(id))
{
// Here you can play with some bodys to see the number of them and determine what body for what class
dod_set_body_number(id, body_number[id])
}
return PLUGIN_CONTINUE
}
public dod_client_spawn(id)
{
if(!is_user_connected(id))
{
// Here you can play with some bodys to see the number of them and determine what body for what class
dod_set_body_number(id, body_number[id])
}
return PLUGIN_CONTINUE
}
public fw_precache(const file[])
{
enforce(file)
return FMRES_IGNORED
}
public enforce(const file[])
{
force_unmodified(force_exactfile, {0,0,0}, {0,0,0}, file)
}
public inconsistent_file(id, const filename[], reason[64])
{
format(reason, 63, "Delete %s and reconnect to get proper file!", filename)
return PLUGIN_CONTINUE
}