try this
PHP Code:
#include <amxmodx>
#include <cstrike>
#include <fun>
#include <hamsandwich>
new g_pCvar_Price;
new bool:awpmap = false;
public plugin_init()
{
register_plugin("Buy AWP", "0.0.1", "dinnk.");
register_clcmd("say /awp", "CmdAwp");
g_pCvar_Price = register_cvar("awp_deagle_price", "15000");
RegisterHam( Ham_Spawn, "player", "FwdHamPlayerSpawn", 1 );
}
public plugin_cfg(){
new szMapName[64];
get_mapname(szMapName, 63);
if(equali(szMapName, "awp_"))
awpmap = true;
}
public FwdHamPlayerSpawn(id) {
if(!is_user_alive(id) || !awpmap)
return;
strip_user_weapons(id)
give_item(id, "weapon_knife")
give_item(id, "weapon_awp")
give_item(id, "weapon_deagle")
cs_set_user_bpammo(id, CSW_AWP, 30)
cs_set_user_bpammo(id, CSW_DEAGLE, 35)
}
public CmdAwp(id)
{
new iMoney = cs_get_user_money(id);
new iPrice = get_pcvar_num(g_pCvar_Price);
if( !is_user_alive(id) )
{
client_print(id, print_chat, "* You need to be alive !");
return PLUGIN_HANDLED;
}
if( iMoney < iPrice )
{
client_print(id, print_chat, "* You need more money ! ($%i)", iPrice);
return PLUGIN_HANDLED;
}
give_item(id, "weapon_awp");
give_item(id, "weapon_deagle");
cs_set_user_bpammo(id, CSW_AWP, 30);
cs_set_user_bpammo(id, CSW_DEAGLE, 35);
client_print(id, print_chat, "* You bought an AWP & Deagle for $%i !", iPrice);
cs_set_user_money(id, iMoney - iPrice, true);
return PLUGIN_HANDLED;
}