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

View Poll Results: Do you Like This Plugin?
Yes 2 33.33%
No 4 66.67%
Voters: 6. You may not vote on this poll

shop


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   Counter-Strike        Category:   Technical/Development       
Dawood Najam
Junior Member
Join Date: Mar 2014
Location: Lahore, Pakistan
Old 03-27-2014 , 07:00   shop
Reply With Quote #1

This plugin allows you or your server's players to buy weapon in your server.
Type shop to display the shop menu.
No cvars are added yet.
Attached Files
File Type: sma Get Plugin or Get Source (shop.sma - 610 views - 2.6 KB)

Last edited by hornet; 03-27-2014 at 20:35.
Dawood Najam is offline
Blizzard_87
Veteran Member
Join Date: Oct 2012
Old 03-27-2014 , 07:11   Re: shop
Reply With Quote #2

Remove the AMXX file.

this is redundent.

EDIT:

funny how close this resembles my Shop TUT...
https://forums.alliedmods.net/showthread.php?t=213223

try not to release plugins which are made by other people...
__________________

Last edited by Blizzard_87; 03-27-2014 at 08:24.
Blizzard_87 is offline
wickedd
Veteran Member
Join Date: Nov 2009
Old 03-27-2014 , 08:26   Re: shop
Reply With Quote #3

You didn't write this, all you did was edit a post made be Connor.

Here's Connor code:

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

#define PLUGIN "shop tut"
#define VERSION "1.0"
#define AUTHOR "Blizzard"

new g_shop_menu
new g_iBlinkAcct

new const Cannot_Carry_Anymore[] = "#Cstrike_TitlesTXT_Cannot_Carry_Anymore"

new g_szItems[][] = 
{
    
"HE Grenade",
    
"Flash Grenade",
    
"Smoke Grenade"
}

new 
g_iItemsPrices[] = 
{
    
400,
    
300,
    
400,
}

public 
plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)

    
register_clcmd("say /shop""cmdShop")

    
g_iBlinkAcct get_user_msgid("BlinkAcct")

    
g_shop_menu menu_create("\yShop Menu\R$""handler_ShopMenu")

    new 
szItemName[32]
    for(new 
ii<sizeof(g_szItems) && i<sizeof(g_iItemsPrices); i++)
    {
        
formatex(szItemNamecharsmax(szItemName), "%s\y\R%d"g_szItems], g_iItemsPrices])
        
menu_additem(g_shop_menuszItemName)
    }
    
menu_setprop(g_shop_menuMPROP_NUMBER_COLOR"\w")
}

public 
cmdShop(id)
{
    
menu_display(idg_shop_menu)
}

public 
handler_ShopMenu(idmenuitem)
{
    if( 
item >= && is_user_alive(id) )
    {
        new 
new_money cs_get_user_money(id) - g_iItemsPrices[item]
        if( 
new_money )
        {
            
client_print(idprint_center"#Cstrike_TitlesTXT_Not_Enough_Money")
            
            
message_begin(MSG_ONE_UNRELIABLEg_iBlinkAcct, .player=id)
            {
                
write_byte(2)
            }
            
message_end()
        }

        switch( 
item )
        {
            case 
0:
            {
                if( 
user_has_weapon(idCSW_HEGRENADE) )
                {
                    
client_print(idprint_centerCannot_Carry_Anymore)
                }
                else
                {
                    
give_item(id"weapon_hegrenade")
                    
cs_set_user_money(idnew_money)
                }
            }
            case 
1:
            {
                if( 
cs_get_user_bpammo(idCSW_FLASHBANG) < )
                {
                    
give_item(id"weapon_flashbang")
                    
cs_set_user_money(idnew_money)
                }
                else
                {
                    
client_print(idprint_centerCannot_Carry_Anymore)
                }
            }
            case 
3:
            {
                if( 
user_has_weapon(idCSW_SMOKEGRENADE) )
                {
                    
client_print(idprint_centerCannot_Carry_Anymore)
                }
                else
                {
                    
give_item(id"weapon_smokegrenade")
                    
cs_set_user_money(idnew_money)
                }
            }
        }
    }

Dawood code:

PHP Code:
#include <fun>

#define PLUGIN "shop"
#define VERSION "1.0"
#define AUTHOR "Dawood Najam"

new g_shop_menu
new g_iBlinkAcct

new const Cannot_Carry_Anymore[] = "#Cstrike_TitlesTXT_Cannot_Carry_Anymore"

new g_szItems[][] = 
{
    
"AK47",
    
"M4A1",
    
"AWP"
}

new 
g_iItemsPrices[] = 
{
    
1900,
    
2500,
    
3000,
}

public 
plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)

    
register_clcmd("say shop""cmdShop")

    
g_iBlinkAcct get_user_msgid("BlinkAcct")

    
g_shop_menu menu_create("\yShop Menu\R$""handler_ShopMenu")

    new 
szItemName[32]
    for(new 
ii<sizeof(g_szItems) && i<sizeof(g_iItemsPrices); i++)
    {
        
formatex(szItemNamecharsmax(szItemName), "%s\y\R%d"g_szItems], g_iItemsPrices])
        
menu_additem(g_shop_menuszItemName)
    }
    
menu_setprop(g_shop_menuMPROP_NUMBER_COLOR"\w")
}

public 
cmdShop(id)
{
    
menu_display(idg_shop_menu)
}

public 
handler_ShopMenu(idmenuitem)
{
    if( 
item >= && is_user_alive(id) )
    {
        new 
new_money cs_get_user_money(id) - g_iItemsPrices[item]
        if( 
new_money )
        {
            
client_print(idprint_center"#Cstrike_TitlesTXT_Not_Enough_Money")
            
            
message_begin(MSG_ONE_UNRELIABLEg_iBlinkAcct, .player=id)
            {
                
write_byte(2)
            }
            
message_end()
        }

        switch( 
item )
        {
            case 
0:
            {
                if( 
user_has_weapon(idCSW_AK47) )
                {
                    
client_print(idprint_centerCannot_Carry_Anymore)
                }
                else
                {
                    
give_item(id"weapon_ak47")
                    
cs_set_user_money(id1900)
                }
            }
            case 
1:
            {
                if( 
cs_get_user_bpammo(idCSW_M4A1) < )
                {
                    
give_item(id"weapon_m4a1")
                    
cs_set_user_money(id2500)
                }
                else
                {
                    
client_print(idprint_centerCannot_Carry_Anymore)
                }
            }
            case 
2:
            {
                if( 
user_has_weapon(idCSW_AWP) )
                {
                    
client_print(idprint_centerCannot_Carry_Anymore)
                }
                else
                {
                    
give_item(id"weapon_awp")
                    
cs_set_user_money(id3000)
                }
            }
        }  
    }

__________________
Just buy the fucking game!!!!
I hate No-Steamers and lazy ass people.
wickedd is offline
Blizzard_87
Veteran Member
Join Date: Oct 2012
Old 03-27-2014 , 17:57   Re: shop
Reply With Quote #4

Sorry wickedd. As black Rose stated above. I misunderstood. Fixed my about post.
__________________

Last edited by Blizzard_87; 03-27-2014 at 19:39.
Blizzard_87 is offline
wickedd
Veteran Member
Join Date: Nov 2009
Old 03-27-2014 , 18:10   Re: shop
Reply With Quote #5

It's ok, we all make mistakes.

P.S. Beside, I think you're capable of writing your own code. Unlike Dawood and some of the other members here.
__________________
Just buy the fucking game!!!!
I hate No-Steamers and lazy ass people.

Last edited by wickedd; 03-27-2014 at 18:31.
wickedd is offline
hornet
AMX Mod X Plugin Approver
Join Date: Mar 2010
Location: Australia
Old 03-28-2014 , 03:56   Re: shop
Reply With Quote #6

As pointed out this is clearly nothing more than a copy-paste job with a few edits.

Nuked.
__________________
Quote:
vBulletin Tip #42: Not much would be accomplished by merging this item with itself.
hornet 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 02:02.


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