#include <amxmodx>
#include <cstrike>
new const playermodels[][][]={
{"Menude Cikacak Model Ismi","Player Model Ismi",ADMIN_ALL,0},
{"Adolf Hitler","tsw_hitler",ADMIN_BAN,1},
{"Joseph Stalin","tsw_stalin",ADMIN_BAN,1},
{"Zombie Nazi Soldier","tsw_zmsoldier",ADMIN_BAN,1},
{"Zombie Nazi Officer","tsw_zmofficer",ADMIN_BAN,1},
{"Nazi Ozel Harekat Askeri","tsw_naziozel",ADMIN_BAN,1},
{"U.S.A Ozel Harekat Askeri","tsw_usaozel",ADMIN_BAN,2},
{"Baris Harekati Komandosu","tsw_bkomando",ADMIN_BAN,2}
};
new const tags[3][]={"!n[!tWEBDiyo!n]:","WEBDiyo","wD"};
new const intro[3][]={"Player Model Menu","v0.1","Aconyonn"};
public plugin_init(){
register_plugin(intro[0],intro[1][0],intro[2][0]);
register_clcmd("say /kostum","AnaMenu");
register_clcmd("say_team /kostum","AnaMenu");
}
public plugin_precache(){
for(new i=1;i<sizeof(playermodels);i++){
new model[256]; formatex(model,charsmax(model),"models/player/%s/%s.mdl",playermodels[i][1],playermodels[i][1]);
if(file_exists(model)) precache_model(model);
else log_amx("%s: Bulunamayan Player Modeli: %s",tags[1][0],model);
}
}
public AnaMenu(id){
new Menu=CreateMenu("Kostum Seciniz\y!","AnaMenu_devam");
for(new i=1;i<sizeof(playermodels);i++){
new NumToStr[6]; num_to_str(i,NumToStr,charsmax(NumToStr));
if(get_user_team(id)==1&&playermodels[i][3][0]==1){
NewOption(Menu,"%s",NumToStr,1,playermodels[i][0]);
}
else if(get_user_team(id)==2&&playermodels[i][3][0]==2){
NewOption(Menu,"%s",NumToStr,1,playermodels[i][0])
}
}
Close(id,Menu);
}
public AnaMenu_devam(id,Menu,mWare){
if(mWare==MENU_EXIT){ menu_destroy(Menu); return PLUGIN_HANDLED; }
new mData[6],Empty; menu_item_getinfo(Menu,mWare,Empty,mData,5,_,_,Empty);
new Key=str_to_num(mData); cs_set_user_model(id,playermodels[Key][1]);
renkli_yazi(id,"%s !gBasarili bir sekilde !t[!n%s!t] !gkostumunu giyindiniz..",tags[0],playermodels[Key][0]);
menu_destroy(Menu); return PLUGIN_HANDLED;
}
stock CreateMenu(const title[],const perpetuation[], any:...){
new newtitle[256],menuedit[256]; vformat(menuedit,charsmax(menuedit),title,3);
formatex(newtitle,charsmax(newtitle),"\r( \w%s \r~\w> \y%s \r) \y>> \r( \w%s \r)^n\wSurum: \y[\r%s\y]",tags[1][0],intro[0],menuedit,intro[1][0]);
new Menu=menu_create(newtitle,perpetuation); return Menu;
}
stock NewOption(id,const TitleOption[],const Information[],Tag=1,any:...){
new NewTitleOption[256],EditOption[256]; vformat(EditOption,charsmax(EditOption),TitleOption,5);
if(Tag==1) formatex(NewTitleOption,charsmax(NewTitleOption),"%s \w~\r> \w%s",tags[2][0],EditOption);
else formatex(NewTitleOption,charsmax(NewTitleOption),"%s",EditOption);
menu_additem(id,NewTitleOption,Information);
}
stock Close(id,MenuIndex,Option=1,Exit=1,Page=0){
menu_setprop(MenuIndex,MPROP_EXITNAME,"\rCikis");
menu_setprop(MenuIndex,MPROP_PERPAGE,Option?7:0);
menu_setprop(MenuIndex,MPROP_EXIT,Exit?MEXIT_ALL:MEXIT_NEVER);
menu_display(id,MenuIndex,Page);
/**
-> Eger menuyu 9 secenekli yapmak istiyorsan Close(id,Menu,0) yap.
-> Ve bir ust satira yeni secenek olusturup gonderecegi secenegi 0 yap.
**/
}
#if AMXX_VERSION_NUM < 183
stock renkli_yazi(const id, const input[], any:...){
new count=1,players[32];
static msg[191]; vformat(msg,charsmax(msg),input,3);
replace_all(msg,charsmax(msg),"!g","^x01"); // Default Renk(Sarı)
replace_all(msg,charsmax(msg),"!n","^x04"); // Yeşil Renk
replace_all(msg,charsmax(msg),"!t","^x03"); // Takım Renk( CT mavi , T kırmızı )
if(id) players[0]=id; else get_players(players,count,"ch");{
for (new i=0;i<count;i++){
if(is_user_connected(players[i])){
message_begin(MSG_ONE_UNRELIABLE,get_user_msgid("SayText"),_,players[i]);
write_byte(players[i]),write_string(msg),message_end();
}
}
}
}
#else
stock renkli_yazi(const id,const input[],any:...){
static msg[191]; vformat(msg,charsmax(msg),input,3);
replace_all(msg,charsmax(msg),"!g","^x01"),replace_all(msg,charsmax(msg),"!n","^x04"),replace_all(msg,charsmax(msg),"!t","^x03");
client_print_color(id,id,msg);
}
#endif