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

Xp shop


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
AkkYrOcK
Junior Member
Join Date: Aug 2016
Location: Streat
Old 12-05-2016 , 01:09   Xp shop
Reply With Quote #1

i have add to this shop more items
(ex: health , double damage, speed , unlimited ammo, all grenades pack, chameleon, no recoil, gravity)
note:- this shop items unlock bye level

ex:- 1.health [unlock to level 1]
2.double damage [unlock to level 2]

this type

Code:
#include <amxmodx> 
#include <fun> 


new purchasedFlashiCount[33];
new bool:purchasedFlash[33];

public plugin_init() 
{ 
    register_logevent( "logevent_RoundStart", 2, "1=Round_Start" ); 
    
    register_clcmd("say /flash", "ShowMenu"); 
} 

public logevent_RoundStart()
{
    
    new iPlayers[32], iCount
    
    get_players(iPlayers, iCount, "ch")
    if( !iCount ) return
    
    new id

    for(--iCount; iCount>=0; iCount--)
    {
        id = iPlayers[iCount]
        
        if(purchasedFlash[id]) purchasedFlashiCount[id]++;
        
    }
}
public ShowMenu(id) { 
    if(is_user_alive(id)){
        
        if(purchasedFlashiCount[id] == 0){
            
            new menu = menu_create("Grenade_Menu", "mh_MyMenu"); 
            menu_additem(menu, "flashbang", "", 0); // case 0 
            menu_display(id, menu, 0); 
            
        }
        else{
            
            client_print(id, 3, "You need to wait for 1 more round to use Grenade_Menu.")
            
        }
    }
    else{
        
        client_print(id, 3, "You need to be alive to use Grenade_Menu.")
        
    }
    return PLUGIN_HANDLED; 
    
}
public mh_MyMenu(id, menu, item) 
{ 
    switch(item) 
    { 
        case 0:  
        { 
            give_item(id, "weapon_flashbang"); 
            client_print(id, print_chat, "You have purchased flashbang"); 
            
            purchasedFlash[id] = true;
            purchasedFlashiCount[id]--;
        } 
    } 
    menu_destroy(menu); 
    return PLUGIN_HANDLED; 
}
sorry for my bad english
__________________
AkkYrOcK 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 07:54.


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