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

[CS] Change cost of SGren


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

Quote:
Originally Posted by NiHiLaNTh View Post
that function is supported by the older versions of amx mod x too. Its just not integrated. Here it is.
Well, now isnt really necessary.
Anyway i got my pc and i just found one bug.

Actually the buytime is set in freezetime moment. Yet, it also set buytime AGAIN when it ends. So if your freeze time is higher than buytime, you wont be able to buy till freeze time ends. Valve, you have failed this game, i will call the Arrow.

Anyway can someone tell me whats the name for the messages You Cannot Carry Anymore and Buy Time ended? Not finding the correct ones.

I will let here the code, if someone knows the messages, let me know for update the code.

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

#define VERSION "0.0.1"
#define TASK_BUYTIME 418123

new price 300
new bool:CanBuy

public plugin_init() {
    
register_plugin("SmokeGrenade Price Change"VERSION"Jhob94")
    
    
register_event("HLTV""Round_New""a""1=0""2=0" // New Round
    
register_event("TextMsg""Round_Crap""a""2&#Game_C""2&#Game_w"// Game restart/commecing
    
register_logevent("Fix_Buy_Time"2"1=Round_Start"// Register buy time at round start
    
register_logevent("Round_Crap"2"1=Round_End")  // Round End
    
    
register_clcmd("sgren""Buy_Smoke"0// VGUI Menu
    
register_menucmd(register_menuid("BuyItem"),(1<<4),"OS_Smoke"// Old-Style Menu
}

public 
Round_New() CanBuy true

public Fix_Buy_Time() set_task(get_cvar_float("mp_buytime") * 60.0"Can_Not_Buy"TASK_BUYTIME)

public 
Round_Crap()
{
    if(
task_exists(TASK_BUYTIME))
        
remove_task(TASK_BUYTIME)
}

public 
Can_Not_Buy() CanBuy false

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

public 
Buy_Smoke(idOS)
{
    if(!
CanBuy)
        
client_print(idprint_center"Buy Time Expired")
        
    else
    {
        if(
user_has_weapon(idCSW_SMOKEGRENADE))
            
client_print(idprint_center"You Cannot Carry Anymore!")
        
        else
        {
            new 
cur_money cs_get_user_money(id)
            
            if(
cur_money price)
                
client_print(idprint_center"#Not_Enough_Money")
            
            else
            {
                
give_item(id"weapon_smokegrenade")
                
cs_set_user_money(idcur_money price1)
            }
        }
    }
    
    if(
OS)
        
engclient_cmd(id"menuselect" ,"10")
    
    return 
PLUGIN_HANDLED

__________________
Jhob94 is offline
Phant
Veteran Member
Join Date: Sep 2009
Location: New Jersey
Old 12-22-2014 , 18:14   Re: [CS] Change cost of SGren
Reply With Quote #12

Quote:
Originally Posted by Jhob94 View Post
Yet, it also set buytime AGAIN when it ends.
By the way: after round end moment (CT/T Win, Round Draw, C4 Exp/Def, etc.) — buying is on! It's another idea for fix-way plugin (disable buying).
Phant is offline
Send a message via ICQ to Phant
Jhob94
AMX Mod X Donor
Join Date: Jul 2012
Old 12-23-2014 , 04:20   Re: [CS] Change cost of SGren
Reply With Quote #13

It isn't possible to buy it on round end. You want it to be possible? Or is it buging?
__________________
Jhob94 is offline
Phant
Veteran Member
Join Date: Sep 2009
Location: New Jersey
Old 12-23-2014 , 11:46   Re: [CS] Change cost of SGren
Reply With Quote #14

Quote:
Originally Posted by Jhob94 View Post
It isn't possible to buy it on round end. You want it to be possible? Or is it buging?
I just say about buying possibility when round end, here is video:

So, I think it's bug and would be great to fix it (disable buying after 00:00).
Phant is offline
Send a message via ICQ to Phant
Jhob94
AMX Mod X Donor
Join Date: Jul 2012
Old 12-23-2014 , 14:05   Re: [CS] Change cost of SGren
Reply With Quote #15

Quote:
Originally Posted by Phant View Post
I just say about buying possibility when round end, here is video:

So, I think it's bug and would be great to fix it (disable buying after 00:00).
Oh its already from default game. Yes it is possible. Will do it later or tomorrow (bit busy for now)
__________________
Jhob94 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 01:45.


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