Raised This Month: $ Target: $400
 0% 

Item for money?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
unnyquee
Senior Member
Join Date: Jun 2009
Location: Constanta, Romania
Old 10-30-2009 , 07:48   Re: Item for money?
Reply With Quote #2

There's no such event.. after you blocked the buy commands, you can do something like this:

PHP Code:
// in your includes
#include <cstrike> // for cs_set_user_bpammo
#include <fun> // for give_item

// in your plugin_init()
pCvarCostAk register_cvar("buy_ak_cost");
register_clcmd("say /ak47""cmdBuyAK");

// in cmdBuyAk
new iMoney get_pcvar_num(pCvarCostAk);

if(
cs_get_user_money(id) < iMoney)
{
     
client_print(idprint_center"#Cstrike_TitlesTXT_Not_Enough_Money");
     return 
PLUGIN_HANDLED;
}
give_item(id"weapon_ak47");
cs_set_user_bpammo(id"weapon_ak47"0);
cs_set_weapon_ammo("weapon_ak47"30);

cs_set_user_money(idcs_get_user_money iMoney1); 
__________________

Last edited by unnyquee; 10-30-2009 at 08:00.
unnyquee 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 17:46.


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