Hi all, why this code doesn't work?
Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <hamsandwich>
#include <zombieplague>
#define PLUGIN "[ZP] Special Player Models"
#define VERSION "1.0"
#define AUTHOR "HakimKILLER44"
new const model_list[][][] =
{
{ "HakimKILLER44", {"owner_human_stonre", "owner_human_troll"}} // oyuncu id ve ya ismi,
}
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
RegisterHam(Ham_Spawn, "player", "ham_spawn_post", 1)
}
public plugin_precache()
{
new modelstring[128]
for (new i = 0; i < sizeof(model_list); i++)
{
for (new j = 0; j < sizeof(model_list[i][1]); j++)
{
formatex(modelstring, modelstring, "models/player/%s/%s.mdl", model_list[i][1][j], model_list[i][1][j])
precache_model(modelstring)
}
}
}
public ham_spawn_post(id)
{
if (id < 1 || id > get_maxplayers())
return
if (!is_user_connected(id) || zp_get_user_zombie(id))
return
set_user_human_model(id)
}
public zp_user_humanized_post(id)
{
if (id < 1 || id > get_maxplayers())
return
if (!is_user_connected(id) || zp_get_user_zombie(id))
return
set_user_human_model(id)
}
public set_user_human_model(id)
{
new name[32], auth[35]
get_user_authid(id, auth, charsmax(auth))
get_user_name(id, name, charsmax(name))
for (new i = 0; i < sizeof(model_list); i++)
{
if (containi(model_list[i][0], "STEAM_") != 1) // with steamid
{
new random_model = model_list[i][1][random_num(0, charsmax(model_list[i][1]) - 1)]
cs_set_user_model(id, random_model)
}
else // with name
{
new random_model = model_list[i][1][random_num(0, charsmax(model_list[i][1]) - 1)]
cs_set_user_model(id, random_model)
}
}
}