Raised This Month: $ Target: $400
 0% 

Can someone help me ?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
poliisi299
Senior Member
Join Date: May 2011
Old 10-28-2011 , 13:10   Can someone help me ?
Reply With Quote #1

plzz help me, i need two plugin in one. 1 plugin Grenade Sack. 2 my plugin code are down, can someone help how can get this plugin in one
2 code

#include <cstrike>
#include <fun>
#include <hamsandwich>

new const PLUGIN[] = "grenadeshop"
new const VERSION[] = "0.1"
new const AUTHOR[] = "quark"

public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)

register_clcmd("say /nades", "grenadeshop")
register_clcmd("say nades", "grenadeshop")
}

public grenadeshop(id)
{
if(is_user_alive(id))
{
new ShopMenu = menu_create("Nades Shop", "shop_handler")
menu_additem(ShopMenu, "Blast Nades (500$)", "1", id)
menu_additem(ShopMenu, "Fire Nades (750$)", "2", id)
menu_additem(ShopMenu, "Frost Nades (500$)", "3", id)
menu_setprop(ShopMenu, MPROP_EXIT, MEXIT_ALL);
menu_setprop(ShopMenu, MPROP_NUMBER_COLOR, "\y");
menu_display(id, ShopMenu, 0)
}
return PLUGIN_CONTINUE
}

public shop_handler(id, ShopMenu, item)
{
new money = cs_get_user_money(id)
switch(item)
{
case 0:
{
if(money >= 500)
{
new setmoney = money - 500
cs_set_user_money(id, clamp(setmoney, 0, 50000))
give_item(id, "weapon_hegrenade")
client_print(id, print_chat, "You have Blast Nade")
}
else client_print(id, print_chat, "You Dont Have Now Money")
}
case 1:
{
if(money >= 750)
{
new setmoney = money - 750
cs_set_user_money(id, clamp(setmoney, 0, 50000))
give_item(id, "weapon_flashbang")
client_print(id, print_chat, "You have Fire Nade")
}
else client_print(id, print_chat, "You Dont Have Now Money")
}
case 2:
{
if(money >= 500)
{
new setmoney = money - 500
cs_set_user_money(id, clamp(setmoney, 0, 50000))
give_item(id, "weapon_smokegrenade")
client_print(id, print_chat, "You Have Frost Nade")
}
else client_print(id, print_chat, "You Dont Have Now Money")
}
}
}
poliisi299 is offline
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 10-28-2011 , 13:28   Re: Can someone help me ?
Reply With Quote #2

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

new const PLUGIN[] = "grenadeshop"
new const VERSION[] = "0.1"
new const AUTHOR[] = "quark"

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_clcmd("say /nades""grenadeshop")
    
register_clcmd("say nades""grenadeshop")
}

public 
grenadeshop(id)
{
    if(
is_user_alive(id))
    {
        new 
ShopMenu menu_create("Nades Shop""shop_handler")
        
menu_additem(ShopMenu"Blast Nades (500$)""1"id)
        
menu_additem(ShopMenu"Fire Nades (750$)""2"id)
        
menu_additem(ShopMenu"Frost Nades (500$)""3"id)
        
menu_setprop(ShopMenuMPROP_EXITMEXIT_ALL);
        
menu_setprop(ShopMenuMPROP_NUMBER_COLOR"\y");
        
menu_display(idShopMenu0)
    }
    return 
PLUGIN_CONTINUE
}

public 
shop_handler(idShopMenuitem)
{
    new 
money cs_get_user_money(id)
    switch(
item)
    {
        case 
0:
        {
            if(
money >= 500)
            {
                new 
setmoney money 500
                cs_set_user_money
(idclamp(setmoney050000))
                
give_item(id"weapon_hegrenade")
                
client_print(idprint_chat"You have Blast Nade")
            }
            else 
client_print(idprint_chat"You Dont Have Now Money")
        }
        case 
1:
        {
            if(
money >= 750)
            {
                new 
setmoney money 750
                cs_set_user_money
(idclamp(setmoney050000))
                
give_item(id"weapon_flashbang")
                
client_print(idprint_chat"You have Fire Nade")
            }
            else 
client_print(idprint_chat"You Dont Have Now Money")
        }
        case 
2:
        {
            if(
money >= 500)
            {
                new 
setmoney money 500
                cs_set_user_money
(idclamp(setmoney050000))
                
give_item(id"weapon_smokegrenade")
                
client_print(idprint_chat"You Have Frost Nade")
            }
            else 
client_print(idprint_chat"You Dont Have Now Money")
        }
    }

Thanks for using my code @ JailBreakShop but next time leave the #include <amxmodx> in it..
__________________
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
quark
Veteran Member
Join Date: Oct 2011
Location: Your mind.
Old 11-18-2011 , 19:10   Re: Can someone help me ?
Reply With Quote #3

NOT LOL
__________________

Check out My Plugins:
qServerInfo ; ASKTAG
quark is offline
Backstabnoob
BANNED
Join Date: Feb 2009
Location: Iwotadai Dorm
Old 11-18-2011 , 19:14   Re: Can someone help me ?
Reply With Quote #4

Quote:
Originally Posted by Napoleon_be View Post
PHP Code:
... 
Thanks for using my code @ JailBreakShop but next time leave the #include <amxmodx> in it..
Sorry but the code is one of the most easiest to write, it's not optimized and coded badly so it can cause errors. I wouldn't dare to say something like "my code" when talking about creating a custom menu that only checks if the user has required money and gives grenades. If by any chance this is your work, you even failed at doing it.

Last edited by Backstabnoob; 11-18-2011 at 19:17.
Backstabnoob is offline
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 11-18-2011 , 20:05   Re: Can someone help me ?
Reply With Quote #5

Quote:
Originally Posted by Backstabnoob View Post
Sorry but the code is one of the most easiest to write, it's not optimized and coded badly so it can cause errors. I wouldn't dare to say something like "my code" when talking about creating a custom menu that only checks if the user has required money and gives grenades. If by any chance this is your work, you even failed at doing it.
This was coded like a month ago, i improved a lot in that time:
PHP Code:
#include <amxmodx>
#include <cstrike>
#include <fun>
#include <hamsandwich>

new const VERSION[] = "0.1"

new const g_szShopItems[3][] = {
    
"Blast Nades",
    
"Fire Nades",
    
"Frost Nades"
}

new const 
iShopPrices[3] = {
    
500,
    
750,
    
500
}

public 
plugin_init()
{
    
register_plugin("Grenade Shop"VERSION"quark")
    
register_clcmd("say /nades""grenadeshop")
    
register_clcmd("say nades""grenadeshop")
}

public 
grenadeshop(id)
{
    if(
is_user_alive(id))
    {
        new 
menu menu_create("Nades Shop""shop_handler")
        for(new 
0sizeof(g_szShopItems); i++) {
            new 
szTemp[500], Key[6]
            
            
formatex(szTempcharsmax(szTemp), "%s [%i$]"cs_get_user_money(id) >= iShopPrices[i] ? "\r" "\d"g_szShopItems[i], iShopPrices[i])
            
num_to_str(iKeycharsmax(Key))
            
menu_additem(menuszTempKey)
        }
        
menu_display(idmenu)
    }
    else {
        
client_print(idprint_chat"You have to be alive to open the shop!")
    }
    return 
PLUGIN_CONTINUE
}

public 
shop_handler(idShopMenuitem)
{
    new 
money cs_get_user_money(id)
    switch(
item)
    {
        case 
0:
        {
            if(
money >= 500)
            {
                new 
setmoney money 500
                cs_set_user_money
(idclamp(setmoney050000))
                
give_item(id"weapon_hegrenade")
                
client_print(idprint_chat"You have Blast Nade")
            }
            else {
                
client_print(idprint_chat"You Dont Have Now Money")
            }
        }
        case 
1:
        {
            if(
money >= 750)
            {
                new 
setmoney money 750
                cs_set_user_money
(idclamp(setmoney050000))
                
give_item(id"weapon_flashbang")
                
client_print(idprint_chat"You have Fire Nade")
            }
            else {
                
client_print(idprint_chat"You Dont Have Now Money")
            }
        }
        case 
2:
        {
            if(
money >= 500)
            {
                new 
setmoney money 500
                cs_set_user_money
(idclamp(setmoney050000))
                
give_item(id"weapon_smokegrenade")
                
client_print(idprint_chat"You Have Frost Nade")
            }
            else {
                
client_print(idprint_chat"You Dont Have Now Money")
            }
        }
    }

__________________

Last edited by Napoleon_be; 11-18-2011 at 20:05.
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
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 14:21.


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