PHP- Kodu:
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <amxmisc>
#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"
new pwcache[33][32];
new bool:Yeni_Sifre_Giris[33];
new bool:Yeni_Sifre_Dogrula_Giris[33];
new bool:Eski_Sifre_Giris[33];
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_clcmd("Eski_Sifre","mEski_Sifre")
register_clcmd("Yeni_Sifre","mYeni_Sifre")
register_clcmd("Yeni_Sifre_Dogrula","mYeni_Sifre_Dogrula")
register_clcmd("say /rcon","RconMenu")
}
public RconMenu(id) {
if(!access(id,ADMIN_RCON)) return PLUGIN_CONTINUE
new menu = menu_create("\rRcon Menu","RconMenu_Handle")
menu_additem(menu,"Sxe Ac","1",ADMIN_RCON)
menu_additem(menu,"Sxe Opsiyonel","2",ADMIN_RCON)
menu_additem(menu,"Sxe Kapat","3",ADMIN_RCON)
menu_additem(menu,"Rcon Sifre Degistir","4",ADMIN_RCON)
menu_additem(menu,"Rcon Restart","5",ADMIN_RCON)
menu_setprop(menu,MPROP_EXIT,MEXIT_ALL)
menu_display(id,menu,0)
return PLUGIN_HANDLED
}
public RconMenu_Handle(id,menu,item) {
if(item == MENU_EXIT) {
menu_destroy(menu)
return PLUGIN_HANDLED
}
new data[6],name[32];
new access,callback;
menu_item_getinfo(menu,item,access,data,5,name,31,callback)
switch(str_to_num(data)) {
case 1:{
server_cmd("__sxei_required 1")
}
case 2:{
server_cmd("__sxei_required 0")
}
case 3:{
server_cmd("__sxei_required -1")
}
case 4:{
client_print(id,print_chat,"Suanki Rcon Sifresini Giriniz.")
client_cmd(id,"messagemode Eski_Sifre")
Eski_Sifre_Giris[id] = true;
}
case 5:{
server_cmd("restart")
}
}
menu_destroy(menu)
return PLUGIN_HANDLED
}
public mEski_Sifre(id) {
if(!Eski_Sifre_Giris[id]) {
console_cmd(id,"Gecersiz Istek")
return PLUGIN_HANDLED
}
new text[32],rconpw[32];
get_cvar_string("rcon_password",rconpw,31)
read_args(text,31)
remove_quotes(text)
if(!equal(rconpw,text)) {
client_print(id,print_chat,"ERISIM BLOKLANDI: Yanlis Sifre !")
return PLUGIN_HANDLED
}
client_print(id,print_chat,"Yeni Rcon Sifresini Giriniz.")
client_cmd(id,"messagemode Yeni_Sifre")
Yeni_Sifre_Giris[id] = true;
Eski_Sifre_Giris[id] = false;
return PLUGIN_HANDLED
}
public mYeni_Sifre(id) {
if(!Yeni_Sifre_Giris[id]) {
console_cmd(id,"Gecersiz Istek")
return PLUGIN_HANDLED
}
new text[32];
read_args(text,31)
remove_quotes(text)
copy(pwcache[id],31,text)
client_print(id,print_chat,"Yeni Rcon Sifresini Dogrulayiniz.")
client_cmd(id,"messagemode Yeni_Sifre_Dogrula")
Yeni_Sifre_Dogrula_Giris[id] = true;
Yeni_Sifre_Giris[id] = false;
return PLUGIN_HANDLED
}
public mYeni_Sifre_Dogrula(id) {
if(!Yeni_Sifre_Dogrula_Giris[id]) {
console_cmd(id,"Gecersiz Istek")
return PLUGIN_HANDLED
}
new text[32];
read_args(text,31)
remove_quotes(text)
if(!equal(text,pwcache[id])) {
client_print(id,print_chat,"ERISIM BLOKLANDI: Sifreler Uyusmuyor !")
return PLUGIN_HANDLED
}
set_cvar_string("rcon_password",text)
client_print(id,print_chat,"ERISIM DOGRULANDI: Yeni Sifrenizi Basariyla [ %s ] Olarak Ayarladiniz !",text)
Yeni_Sifre_Dogrula_Giris[id] = false;
return PLUGIN_HANDLED
}
Bir dene bakalım