Hello everyone!
I've got Ammopaki plugin, but its not my job.
There is option in it, when I type:
/buy
it shows me menu with extra items, which can be bought by TT, CT or everyone.
EXample:
1.ITEM #1 (TT) - price
2 ITEM #2 (CT) - price
3.ITEM #3 (ALL) - price
And here is what im asking for. Could you recreate my plugin to funcion
that this menu would show only those things, which me, or my team can buy
E.G
I'm CT, so I see only CT, or ALL things
I'm TT, so I see only TT, or ALL things.
Code !
PHP Code:
public pokaz_menu(id){
if(!is_user_alive(id)){
client_print(id,print_chat,"Musisz byc zywy aby korzystac ze sklepu")
return PLUGIN_HANDLED
}
mKup_przedmiot = menu_create("Kup_przedmiot", "mh_Kup_przedmiot")
mcbKup_przedmiot = menu_makecallback("mcb_Kup_przedmiot")
new size=ArraySize(koszta_itemow)
for(new i=0;i<size;i++){
static text[128],nazwa[33],koszt,team,teams[16]
ArrayGetString(nazwy_itemow,i,nazwa,32)
koszt=ArrayGetCell(koszta_itemow,i)
team=ArrayGetCell(teamy_itemow,i)
switch(team){
case 0:{
teams="ALL"
}
case 1:{
teams="ZOMBIE"
}
case 2:{
teams="HUMAN"
}
}
if(team!=get_user_team(id) && team!=0)
format(text,127,"%s - Tylko dla %s ",nazwa,teams)
else format(text,127,"%s -\y%d\w (%s)",nazwa,koszt,teams)
menu_additem(mKup_przedmiot, text,"ma_Kup_prezdmiot", ADMIN_ALL, mcbKup_przedmiot)
}
menu_display(id, mKup_przedmiot, 0)
return PLUGIN_CONTINUE
}
public kup(id,koszt){
ammo_packi[id]-=koszt
}
public mh_Kup_przedmiot(id, menu, item) {
new result
if(item>-1){
ExecuteForward(kup_item, result, id, item);
if(result>=AP_HANDLED){
menu_destroy(menu)
return PLUGIN_HANDLED
}
new koszt =ArrayGetCell(koszta_itemow,item)
kup(id,koszt)
menu_destroy(menu)
}
return PLUGIN_CONTINUE
}
__________________