/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <hamsandwich>
#define PLUGIN "AWP Menu"
#define VERSION "1.0"
#define AUTHOR "Noeldayi"
#define serverismi "CSDuragi"
new const Awp1Model[66] = "models/awpmenu/Dragon.mdl";
new const Awp2Model[66] = "models/awpmenu/Gold.mdl";
new const Awp3Model[66] = "models/awpmenu/Hyper.mdl";
new const Awp4Model[66] = "models/awpmenu/Red.mdl";
new const Awp6Model[66] = "models/awpmenu/taan.mdl";
new bool: Awp1[33];
new bool: Awp2[33];
new bool: Awp3[33];
new bool: Awp4[33];
new bool: Awp6[33];
new bool: AwpKitle[33];
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_clcmd("say /awpmenu","Menu")
RegisterHam(Ham_Spawn, "player", "oyuncu_dogunca", 1);
register_event("CurWeapon", "CurentWeapon", "be", "1=1");
}
public Menu(id) {
new menu = menu_create("\d[\rCSDuragi \y| \rClan\d] \r// \wAWP Menu \r\\ ^n\d // CSXX.CSDuragi.COM // \r- \r\\ \dTSXX.CSDuragi.COM \r//", "menu_handler")
menu_additem(menu, "\d[CSDuragi] \w-- \rAWP Asimow", "1", 0);
menu_additem(menu, "\d[CSDuragi] \w-- \rAWP DragonLore", "2");
menu_additem(menu, "\d[CSDuragi] \w-- \rAWP HyperBeast", "3", 0);
menu_additem(menu, "\d[CSDuragi] \w-- \rAWP Phobos \d[ADMIN_BAN]", "4"); // Burdakini kaldırıp casye koydum
menu_additem(menu, "\d[CSDuragi] \w-- \rAWP Medusa \d[ADMIN_BAN]", "6");
menu_setprop(menu,MPROP_NEXTNAME,"\yIleri")
menu_setprop(menu,MPROP_BACKNAME,"\yGeri")
menu_setprop(menu,MPROP_EXITNAME,"\yCIKIS");
menu_setprop(menu, MPROP_EXIT, MEXIT_ALL);
menu_display(id, menu, 0);
return PLUGIN_CONTINUE
}
public menu_handler(id, menu, item)
{
if( item == MENU_EXIT )
{
menu_destroy(menu);
return PLUGIN_HANDLED;
}
new data[6], iName[64];
new access, callback;
menu_item_getinfo(menu, item, access, data,5, iName, 63, callback);
new key = str_to_num(data);
new adminismi[32]
get_user_name(id,adminismi,31)
switch(key)
{
case 1: {
AwpKitle[id] = true;
Awp1[id] = true;
CurentWeapon(id);
renkli_yazi(id, "!t[ !g%s !t] !nAWP Dragon'u Sectiniz",serverismi)
}
case 2: {
AwpKitle[id] = true;
Awp2[id] = true;
CurentWeapon(id);
renkli_yazi(id, "!t[ !g%s !t] !nAWP Gold'yi Sectiniz",serverismi)
}
case 3: {
AwpKitle[id] = true;
Awp3[id] = true;
CurentWeapon(id);
renkli_yazi(id, "!t[ !g%s !t] !nAWP Hyper'i Sectiniz",serverismi)
}
case 4: {
if (get_user_flags(id) & ADMIN_BAN) // Burdan ayarladık eğer ban yetkisi varsa bunlar uygulanacak
AwpKitle[id] = true;
Awp4[id] = true;
CurentWeapon(id);
renkli_yazi(id, "!t[ !g%s !t] !nAWP Red'u Sectiniz",serverismi)
}
else // eğer admin ban yetkisi yoksa bu yazıyı yazar
{
renkli_yazi(id, "!t[ !g%s !t] !nAdmin Ban Yetkin Yok",serverismi)
}
}
case 5: {
}
case 6: {
if (get_user_flags(id) & ADMIN_BAN) // Burdan ayarladık eğer ban yetkisi varsa bunlar uygulanacak
Awp6[id] = true;
AwpKitle[id] = true;
CurentWeapon(id);
renkli_yazi(id, "!t[ !g%s !t] !nAWP taan'yi Sectiniz",serverismi)
}
else // eğer admin ban yetkisi yoksa bu yazıyı yazar
{
renkli_yazi(id, "!t[ !g%s !t] !nAdmin Ban Yetkin Yok",serverismi)
}
}
}
menu_destroy(menu);
return PLUGIN_HANDLED;
}
public oyuncu_dogunca(id)
{
if(is_user_alive(id))
{
AwpKitle[id]= false;
Awp1[id] = false;
Awp2[id] = false;
Awp3[id] = false;
Awp4[id] = false;
Awp6[id] = false;
}
}
public plugin_precache()
{
precache_model(Awp1Model);
precache_model(Awp2Model);
precache_model(Awp3Model);
precache_model(Awp4Model);
precache_model(Awp6Model);
}
public client_putinserver(id)
{
Awp1[id] = false;
Awp2[id] = false;
Awp3[id] = false;
Awp4[id] = false;
Awp6[id] = false;
}
public CurentWeapon(id) {
if(get_user_weapon(id) == CSW_AWP) {
if(Awp1[id])
set_pev(id, pev_viewmodel2, Awp1Model);
if(Awp2[id])
set_pev(id, pev_viewmodel2, Awp2Model);
if(Awp3[id])
set_pev(id, pev_viewmodel2, Awp3Model);
if(Awp4[id])
set_pev(id, pev_viewmodel2, Awp4Model);
if(Awp6[id])
set_pev(id, pev_viewmodel2, Awp6Model);
}
}
/*============================================================
renkli_yazi
============================================================*/
stock renkli_yazi(const id, const input[], any:...)
{
new count = 1, players[32];
static msg[191];
vformat(msg, 190, input, 3);
replace_all(msg, 190, "!n", "^x01"); // Default Renk(Sarı)
replace_all(msg, 190, "!g", "^x04"); // Yeşil Renk
replace_all(msg, 190, "!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();
}
}
}
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1055\\ f0\\ fs16 \n\\ par }
*/