Code:
#include <amxmodx>
#include <amxmisc>
#define PLUGIN "Clothesmod"
#define VERSION "1.0"
#define AUTHOR "Author"
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_srvcmd("item_clothes","item_clothes")
}
public plugin_precache() {
precache_model("models/player/collector-civilian/collector-civilian.mdl")
}
public client_connect(id) {
client_cmd(id,"model collector-civilian")
}
public client_infochanged(id)
{
new oldmodel[32]
new newmodel[32]
get_user_info(id, "model", newmodel, 31)
if(!equali(newmodel, oldmodel))
{
engclient_cmd(id, "model", oldmodel)
client_print(id,print_chat,"[Clothesmod] You may not change clothes that way.")
}
return PLUGIN_HANDLED
}
public item_clothes()
{
new arg[32], arg2[32], id, model
read_argv(1,arg,31)
read_argv(2,arg2,31)
id = str_to_num(arg)
model = str_to_num(arg2)
set_user_info(id,"model",arg2)
client_cmd(id,"model %s",model)
new name[64]
new message[300]
format(message,299,"%s has changed his clothes.",name)
client_print(id,print_chat,"[Clothesmod] You have changed your clothes.")
return PLUGIN_HANDLED
}
this is my code and when i use the item it can change the model but also i can use console to change model with i don't want so how do i restrict them from changing from console?