PHP- Kodu:
#include <amxmodx>
#include <fun>
#include <amxmisc>
#include <jail>
#include <ColorChat>
#define PLUGIN "HP Menu"
#define VERSION "1.0"
#define AUTHOR "K4DavRa"
new
HP1,
HP2,
HP3,
HP4,
HP5;
new Tag[] = "[ Serious - JB ]"
public plugin_init() {
register_plugin(PLUGIN,VERSION,AUTHOR)
register_clcmd("say /hpmenu","Menu")
register_clcmd("say_team /hpmenu","Menu")
HP1 = register_cvar("10hp_fiyat","5")
HP2 = register_cvar("30hp_fiyat","10")
HP3 = register_cvar("50hp_fiyat","20")
HP4 = register_cvar("70hp_fiyat","25")
HP5 = register_cvar("100hp_fiyat","30")
}
public Menu(id) {
if(get_user_team(id) != 1) return PLUGIN_HANDLED
new hostname[64]
get_cvar_string("hostname",hostname,63)
new menu, Menuz[512]
formatex(Menuz, charsmax(Menuz), "\yHP MENU | \r%s",hostname)
menu = menu_create(Menuz, "Menu_Devam")
formatex(Menuz, charsmax(Menuz), "\y10 HP [ \r%d ] JB",get_pcvar_num(HP1))
menu_additem(menu, Menuz, "1")
formatex(Menuz, charsmax(Menuz), "\y30 HP [ \r%d ] JB",get_pcvar_num(HP2))
menu_additem(menu, Menuz, "2")
formatex(Menuz, charsmax(Menuz), "\y50 HP [ \r%d ] JB",get_pcvar_num(HP3))
menu_additem(menu, Menuz, "3")
formatex(Menuz, charsmax(Menuz), "\y70 HP [ \r%d ] JB",get_pcvar_num(HP4))
menu_additem(menu, Menuz, "4")
formatex(Menuz, charsmax(Menuz), "\y100 HP [ \r%d ] JB",get_pcvar_num(HP5))
menu_additem(menu, Menuz, "5")
formatex(Menuz, charsmax(Menuz), "\rCikis")
menu_setprop(menu,MPROP_EXITNAME,Menuz)
menu_display(id, menu, 0)
return PLUGIN_CONTINUE
}
public Menu_Devam(id, menu, item) {
if (item == MENU_EXIT)
{
menu_destroy(menu)
return PLUGIN_CONTINUE
}
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)
switch(key)
{
case 1:
{
if(jb_get_user_packs(id) < get_pcvar_num(HP1)) {
ColorChat(id,GREEN,"%s Uzgunum JB Yeterli Degil.Gereken: %d JB.",Tag,get_pcvar_num(HP1))
return PLUGIN_HANDLED
}
jb_set_user_packs(id,jb_get_user_packs (id) - get_pcvar_num(HP1))
set_user_health(id,get_user_health(id) + 10)
new isim[33];
get_user_name(id,isim,32)
ColorChat(0,GREEN,"%s [ %s ] Isimli Kisi 10 HP Aldi.",Tag,isim)
}
case 2:
{
if(jb_get_user_packs(id) < get_pcvar_num(HP2)) {
ColorChat(id,GREEN,"%s Uzgunum JB Yeterli Degil.Gereken: %d JB.",Tag,get_pcvar_num(HP2))
return PLUGIN_HANDLED
}
jb_set_user_packs(id,jb_get_user_packs (id) - get_pcvar_num(HP2))
set_user_health(id,get_user_health(id) + 30)
new isim[33];
get_user_name(id,isim,32)
ColorChat(0,GREEN,"%s [ %s ] Isimli Kisi 30 HP Aldi.",Tag,isim)
}
case 3: {
if(jb_get_user_packs(id) < get_pcvar_num(HP3)) {
ColorChat(id,GREEN,"%s Uzgunum JB Yeterli Degil.Gereken: %d JB.",Tag,get_pcvar_num(HP3))
return PLUGIN_HANDLED
}
jb_set_user_packs(id,jb_get_user_packs (id) - get_pcvar_num(HP3))
set_user_health(id,get_user_health(id) + 50)
new isim[33];
get_user_name(id,isim,32)
ColorChat(0,GREEN,"%s [ %s ] Isimli Kisi 50 HP Aldi.",Tag,isim)
}
case 4: {
if(jb_get_user_packs(id) < get_pcvar_num(HP4)) {
ColorChat(id,GREEN,"%s Uzgunum JB Yeterli Degil.Gereken: %d JB.",Tag,get_pcvar_num(HP4))
return PLUGIN_HANDLED
}
jb_set_user_packs(id,jb_get_user_packs (id) - get_pcvar_num(HP4))
set_user_health(id,get_user_health(id) + 70)
new isim[33];
get_user_name(id,isim,32)
ColorChat(0,GREEN,"%s ^3[ %s ] ^4Isimli Kisi 70 HP Aldi.",Tag,isim)
}
case 5: {
if(jb_get_user_packs(id) < get_pcvar_num(HP5)) {
ColorChat(id,GREEN,"%s Uzgunum JB Yeterli Degil.Gereken: %d JB.",Tag,get_pcvar_num(HP5))
return PLUGIN_HANDLED
}
jb_set_user_packs(id,jb_get_user_packs (id) - get_pcvar_num(HP5))
set_user_health(id,get_user_health(id) + 100)
new isim[33];
get_user_name(id,isim,32)
ColorChat(0,GREEN,"%s [ %s ] Isimli Kisi 100 HP Aldi.",Tag,isim)
}
}
return PLUGIN_HANDLED
}