How do you think plugins are made? The AmxModX devs used C++/etc to make a nice plugin system.
To make them, you need notepad. To make them usable, you need the compiler located in
Code:
#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <engine>
new num,i,players[32],line,text[64],txtlen,model[41],configsdir[51],dir[61]
public plugin_init()
{
register_plugin("model restriction","0.1","DahVid")
register_clcmd("amx_addresmodel","write_new_model",ADMIN_BAN,"amx_addresmodel <models/bla.mdl>")
register_forward(FM_SetModel,"modelchange",0)
}
public modelchange(id)
{
get_players(players,num)
get_configsdir(configsdir,50)
format(dir,60,"%s/restrictedmodels.ini",configsdir)
if(!file_exists(dir)) {
new begintext[51]
format(begintext,50,"// First time user! File made! --DahVid")
write_file(dir,begintext,-1)
}
for(i = 0; i <= num; i++) {
entity_get_string(i,EV_SZ_model,model,40)
while((line = read_file(dir,line,text,63,txtlen)) != 0) {
if(equali(text,model)) {
client_cmd(i,"disconnect")
console_print(i,"Sorry, this model is restricted!")
}
}
}
}
public write_new_model()
{
new modelname[61]
read_argv(1,modelname,60)
get_players(players,num)
get_configsdir(configsdir,50)
format(dir,60,"%s/restrictedmodels.ini",configsdir)
write_file(dir,modelname,-1)
}
I forgot to mention there is a tool that makes making/editting plugins much easier.