Raised This Month: $ Target: $400
 0% 

[CS] Change cost of SGren


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Jhob94
AMX Mod X Donor
Join Date: Jul 2012
Old 12-22-2014 , 17:05   Re: [CS] Change cost of SGren
Reply With Quote #10

I am not sure if he wants to use a beta version of amxx. Anyway, took some time searching the damn menuid name, but here you go:

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

#define VERSION "0.0.1"

new price 300

public plugin_init() {
    
register_plugin("SmokeGrenade Price Change"VERSION"Jhob94")
    
    
register_clcmd("sgren""Buy_Smoke"0// VGUI Menu
    
register_menucmd(register_menuid("BuyItem"),(1<<4),"OS_Smoke"// Old-Style Menu
}

public 
OS_Smoke(idkey)
{
    if(
key == 4)
        
Buy_Smoke(id1)
}

public 
Buy_Smoke(idOS)
{
    new 
cur_money cs_get_user_money(id)
    
    if(
cur_money price)
        
client_print(idprint_center"#Not_Enough_Money")
    
    else
    {
        if(
user_has_weapon(idCSW_SMOKEGRENADE))
            
client_print(idprint_center"#Cannot_Carry_Anymore")
        
        else
        {
            
give_item(id"weapon_smokegrenade")
            
cs_set_user_money(idcur_money price1)
        }
    }
    
    if(
OS)
        
engclient_cmd(id"menuselect" ,"10")
    
    return 
PLUGIN_HANDLED

Edit:
Will add the task for check about buy time. But, i need to know one thing. The buy time starts at same time as freeze time or when freeze time ends? (cant test since haven't cs at this pc)
__________________

Last edited by Jhob94; 12-22-2014 at 17:10.
Jhob94 is offline
 



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 15:29.


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