Raised This Month: $32 Target: $400
 8% 

[SHOP] HP + Grenade


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Relaxing
AlliedModders Donor
Join Date: Jun 2016
Location: White Plains
Old 06-16-2016 , 10:20   [SHOP] HP + Grenade
Reply With Quote #1

I already know how to do this.

Last edited by Relaxing; 03-30-2018 at 18:59.
Relaxing is offline
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 06-16-2016 , 10:30   Re: [SHOP] HP + Grenade
Reply With Quote #2

i'll get into this when i get home if no one already made it.
__________________
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
mlibre
Veteran Member
Join Date: Nov 2015
Location: return PLUGIN_CONTINUE
Old 06-16-2016 , 14:01   Re: [SHOP] HP + Grenade
Reply With Quote #3

hello try this

Last edited by mlibre; 07-06-2016 at 20:45. Reason: updated v1.1
mlibre is offline
Visinescu
Senior Member
Join Date: Dec 2015
Location: England now,Home Romania
Old 11-25-2016 , 21:03   Re: [SHOP] HP + Grenade
Reply With Quote #4

Quote:
Originally Posted by mlibre View Post
hello try this
End if i want both teams to use it?
Visinescu is offline
guanix
Junior Member
Join Date: Dec 2016
Old 01-13-2017 , 11:49   Re: [SHOP] HP + Grenade
Reply With Quote #5

Quote:
Originally Posted by mlibre View Post
hello try this
Hello , please i want that script to be for both teams if you can help me
guanix is offline
Airkish
AlliedModders Donor
Join Date: Apr 2016
Location: Lithuania
Old 01-13-2017 , 11:52   Re: [SHOP] HP + Grenade
Reply With Quote #6

Quote:
Originally Posted by guanix View Post
Hello , please i want that script to be for both teams if you can help me
Try
PHP Code:
#include <amxmodx> 
#include <amxmisc> 
#include <cstrike> 
#include <fun> 

new chp[26]

public 
plugin_init() { 
    
register_plugin("Shop HP/Grenades""1.1""mlibre"
     
    
chp[0] = register_cvar("amx_50hp_cost""2000")  
    
chp[1] = register_cvar("amx_100hp_cost""4000"
    
chp[2] = register_cvar("amx_150hp_cost""8000"
    
chp[3] = register_cvar("amx_hegrenade_cost""1000"
    
chp[4] = register_cvar("amx_flashbang_cost""500"
    
chp[5] = register_cvar("amx_smokegrenade_cost""1500"
     
    
register_clcmd("say /shop" "my_menu"

public 
my_menu(id) { 
    if (!
is_user_alive(id)) { 
        
client_print(id3"[AMXX] You have to be alive to see the menu"
        return 
PLUGIN_HANDLED 
    
} else { 
        new 
szMenuszMenu menu_create("\yShop HP/Grenades\w""buy_item"
         
        
menu_additem(szMenu"\w50\y HP"""
        
menu_additem(szMenu"\w100\y HP"""
        
menu_additem(szMenu"\w150\y HP"""
        
menu_additem(szMenu"\wHE\y Grenade"""
        
menu_additem(szMenu"\wFlashbang\y Grenade"""
        
menu_additem(szMenu"\wSmoke\y Grenade"""
     
        
menu_display(idszMenu0
        return 
PLUGIN_HANDLED 
    
}
    return 
PLUGIN_HANDLED

public 
buy_item(idmenuitem) { 
    if(
item == MENU_EXITmenu_destroy(menu
    switch(
item) { 
        case 
0: { 
            if (
cs_get_user_money(id) >= get_pcvar_num(chp[0])) cs_set_user_money(idcs_get_user_money(id) - get_pcvar_num(chp[0])), set_user_health(id,get_user_health(id) + 50
            else 
client_print(id3"[AMXX] You need money ^"$%d^" to buy 50HP"get_pcvar_num(chp[0])) 
        } 
        case 
1: { 
            if (
cs_get_user_money(id) >= get_pcvar_num(chp[1])) cs_set_user_money(idcs_get_user_money(id) - get_pcvar_num(chp[1])), set_user_health(id,get_user_health(id) + 100
            else 
client_print(id3"[AMXX] You need money ^"$%d^" to buy 100HP"get_pcvar_num(chp[1])) 
        } 
        case 
2: { 
            if (
cs_get_user_money(id) >= get_pcvar_num(chp[2])) cs_set_user_money(idcs_get_user_money(id) - get_pcvar_num(chp[2])), set_user_health(id,get_user_health(id) + 150
            else 
client_print(id3"[AMXX] You need money ^"$%d^" to buy 150HP"get_pcvar_num(chp[2])) 
        } 
        case 
3: { 
            if (
cs_get_user_money(id) >= get_pcvar_num(chp[3])) cs_set_user_money(idcs_get_user_money(id) - get_pcvar_num(chp[3])), give_item(id"weapon_hegrenade"
            else 
client_print(id3"[AMXX] You need money ^"$%d^" to buy HE Grenade"get_pcvar_num(chp[3])) 
        } 
        case 
4: { 
            if (
cs_get_user_money(id) >= get_pcvar_num(chp[4])) cs_set_user_money(idcs_get_user_money(id) - get_pcvar_num(chp[4])), give_item(id"weapon_flashbang"
            else 
client_print(id3"[AMXX] You need money ^"$%d^" to buy Flashbang Grenade"get_pcvar_num(chp[4])) 
        } 
        case 
5: { 
            if (
cs_get_user_money(id) >= get_pcvar_num(chp[5])) cs_set_user_money(idcs_get_user_money(id) - get_pcvar_num(chp[5])), give_item(id"weapon_smokegrenade"
            else 
client_print(id3"[AMXX] You need money ^"$%d^" to buy Smoke Grenade"get_pcvar_num(chp[5])) 
        } 
    } 
    return 
PLUGIN_HANDLED

__________________
Airkish is offline
ImprovisE
Junior Member
Join Date: Nov 2009
Old 02-09-2018 , 03:29   Re: [SHOP] HP + Grenade
Reply With Quote #7

Why does only the first position in shop menu is active?
ImprovisE is offline
Relaxing
AlliedModders Donor
Join Date: Jun 2016
Location: White Plains
Old 02-09-2018 , 12:27   Re: [SHOP] HP + Grenade
Reply With Quote #8

Quote:
Originally Posted by ImprovisE View Post
Why does only the first position in shop menu is active?
__________________
Relaxing is offline
Relaxing
AlliedModders Donor
Join Date: Jun 2016
Location: White Plains
Old 02-09-2018 , 12:27   Re: [SHOP] HP + Grenade
Reply With Quote #9

Quote:
Originally Posted by ImprovisE View Post
Why does only the first position in shop menu is active?
First position? What's first position? ;p
__________________
Relaxing is offline
ImprovisE
Junior Member
Join Date: Nov 2009
Old 02-09-2018 , 15:17   Re: [SHOP] HP + Grenade
Reply With Quote #10

I could select only the first item in menu, the others were inactive. My mistake. Now the problem is solved, sorry for the anxiety.

Last edited by ImprovisE; 02-09-2018 at 15:18.
ImprovisE is offline
Reply


Thread Tools
Display Modes

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 00:08.


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