Raised This Month: $51 Target: $400
 12% 

[REQ] Ammo Pack Help


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Eagle07
Veteran Member
Join Date: May 2014
Location: Morocco :D
Old 06-08-2014 , 11:54   [REQ] Ammo Pack Help
Reply With Quote #1

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_przedmiottext,"ma_Kup_prezdmiot"ADMIN_ALLmcbKup_przedmiot)
    }
    
menu_display(idmKup_przedmiot0
    
    return 
PLUGIN_CONTINUE
}
public 
kup(id,koszt){
    
    
ammo_packi[id]-=koszt
}
public 
mh_Kup_przedmiot(idmenuitem) {
    
    new 
result
    
if(item>-1){
        
ExecuteForward(kup_itemresultiditem);
    
        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

__________________
Eagle07 is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 19:20.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode