i think this would work, but even though the files exist dont u need a precache anyways? im not sure bout that...
Code:
/* Plugin generated by AMXX-Studio */
// say \camouflage
// say_team \camouflage
// amxx_camouflage <1/0>
#include <amxmodx>
#include <fun>
#include <cstrike>
new PLUGIN[]="Camouflage"
new AUTHOR[]="wouter"
new VERSION[]="1.00"
new CTModels[] =
{
"urban", "gsg9",
"gign", "sas"
}
new TModels[] =
{
"terror", "leet",
"artic", "guerilla"
}
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_clcmd("say /camouflage", "cmd_camouflage")
register_clcmd("say /camouflage", "cmd_camouflage")
register_cvar("amx_camouflage", "1")
}
public cmd_camouflage(id) {
if ( ! get_cvar_num("amxx_camouflage") )
return PLUGIN_HANDLED
new money = cs_get_user_money(id)
new CsTeams:team = cs_get_user_team(id)
if ( !is_user_alive(id) || money < 16000 ) {
client_print(id, print_chat, "You are not alive or do not have enough money!")
return PLUGIN_HANDLED;
}
i = random_num(0,3)
if (team == CS_TEAM_CT) {
cs_set_user_model(id, TModels[i])
cs_set_user_money(id, cs_get_user_money(id) - 16000)
client_print(id, print_chat, "You have bought a camouflage!")
set_hudmessage(255, 255, 255, -1.0, -1.0, 0, 6.0, 10.0)
show_hudmessage(id, "You have bought a camouflage!")
return PLUGIN_CONTINUE;
}
else if (team == CS_TEAM_T) {
cs_set_user_model(id, CTModels[i])
cs_set_user_money(id, cs_get_user_money(id) - 16000)
client_print(id, print_chat, "You have bought a camouflage!")
set_hudmessage(255, 255, 255, -1.0, -1.0, 0, 6.0, 10.0)
show_hudmessage(id, "You have bought a camouflage!")
return PLUGIN_CONTINUE;
}
if ( !is_user_alive(id) ) {
cs_reset_user_model(id)
return PLUGIN_HANDLED;
}
return PLUGIN_HANDLED;
}
/* To Do: set handycap: slow run => Float: get_user_maxspeed ( index ) / Float: set_user_maxspeed ( index, [ Float:speed = - 1.0 ] )
aim at person: tell in hud: enemy! && allie! => Float: get_user_aiming ( index, &id, &body, [ distance,default 9999 ] ) */