PHP- Kodu:
#include <amxmodx>
#include <amxmisc>
#include <ColorChat>
#include <jail>
#define PLUGIN "Yeni Plugin"
#define AUTHOR "K4DavRa"
#define VERSION "1.0"
new jbsalla[33];
new Tag[] = "[ K4 - GardiyanJB ]"
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_clcmd("say /jbver","Yardir")
}
public Yardir(id) {
if( !is_user_alive(id) ) return PLUGIN_HANDLED
if(get_user_team(id) != 2) return PLUGIN_HANDLED
new menu = menu_create("\yGardiyan \rJB \yMenu", "lallo")
menu_additem(menu, "\y5 \rJB \yVER", "1", 0);
menu_additem(menu, "\y10 \rJB \yVER", "2", 0);
menu_additem(menu, "\y20 \rJB \yVER", "3", 0);
menu_additem(menu, "\y50 \rJB \yVER", "4", 0);
menu_additem(menu, "\y100 \rJB \yVER", "5", 0);
menu_setprop(menu, MPROP_EXIT, MEXIT_ALL);
menu_display(id, menu, 0);
return PLUGIN_HANDLED
}
public lallo(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: {
jbsalla[id] = 5;
OyuncuSec(id)
}
case 2: {
jbsalla[id] = 10;
OyuncuSec(id)
}
case 3: {
jbsalla[id] = 20;
OyuncuSec(id)
}
case 4: {
jbsalla[id] = 50;
OyuncuSec(id)
}
case 5: {
jbsalla[id] = 100;
OyuncuSec(id)
}
}
menu_destroy(menu);
return PLUGIN_HANDLED;
}
public OyuncuSec(id)
{
new ad[32],sznum[6]
new menu = menu_create("OYUNCU SECIN","OyuncuHand")
for(new i = 1;i<=get_maxplayers();i++)
if(is_user_connected(i))
{
num_to_str(i,sznum,5)
get_user_name(i,ad,31)
menu_additem(menu,ad,sznum)
}
menu_display(id,menu,0)
return PLUGIN_HANDLED
}
public OyuncuHand(id,menu,item)
{
if(item == MENU_EXIT)
{
menu_destroy(menu)
return PLUGIN_HANDLED
}
new ad[32],callback,access,data[6]
menu_item_getinfo(menu,item,access,data,5,ad,31,callback)
new name[32];
get_user_name(id,name,31)
new tid = str_to_num(data)
get_user_name(tid,ad,31)
if(jbsalla[id] == 5)
{
jb_set_user_packs(tid, jb_get_user_packs(tid) + 5)
ColorChat(id,GREEN,"%s %s Kisiye 5 JB VERDINIZ.",Tag,ad)
ColorChat(tid,GREEN,"%s %s Kisi Size 5 JB VERDI.",Tag,name)
ColorChat(0,GREEN,"%s Isimli Kisi %s Kisiye 5 JB VERDI.",Tag,name)
jbsalla[id] = 0
}
if(jbsalla[id] == 10)
{
jb_set_user_packs(tid, jb_get_user_packs(tid) + 10)
ColorChat(id,GREEN,"%s %s Kisiye 10 JB VERDINIZ.",Tag,ad)
ColorChat(tid,GREEN,"%s %s Kisi Size 10 JB VERDI.",Tag,name)
ColorChat(0,GREEN,"%s Isimli Kisi %s Kisiye 10 JB VERDI.",Tag,name)
jbsalla[id] = 0
}
if(jbsalla[id] == 20)
{
jb_set_user_packs(tid, jb_get_user_packs(tid) + 20)
ColorChat(id,GREEN,"%s %s Kisiye 20 JB VERDINIZ.",Tag,ad)
ColorChat(tid,GREEN,"%s %s Kisi Size 20 JB VERDI.",Tag,name)
ColorChat(0,GREEN,"%s Isimli Kisi %s Kisiye 20 JB VERDI.",Tag,name)
jbsalla[id] = 0
}
if(jbsalla[id] == 50)
{
jb_set_user_packs(tid, jb_get_user_packs(tid) + 50)
ColorChat(id,GREEN,"%s %s Kisiye 50 JB VERDINIZ.",Tag,ad)
ColorChat(tid,GREEN,"%s %s Kisi Size 50 JB VERDI.",Tag,name)
ColorChat(0,GREEN,"%s Isimli Kisi %s Kisiye 50 JB VERDI.",Tag,name)
jbsalla[id] = 0
}
if(jbsalla[id] == 100)
{
jb_set_user_packs(tid, jb_get_user_packs(tid) + 100)
ColorChat(id,GREEN,"%s %s Kisiye 100 JB VERDINIZ.",Tag,ad)
ColorChat(tid,GREEN,"%s %s Kisi Size 100 JB VERDI.",Tag,name)
ColorChat(0,GREEN,"%s Isimli Kisi %s Kisiye 100 JB VERDI.",Tag,name)
jbsalla[id] = 0
}
return PLUGIN_HANDLED
}