public granat(id) {
new kasa = cs_get_user_money(id)
if(!is_user_alive(id)){
client_print(id,print_chat,"[Kupno Granatow] Nie mozesz z tego skorzystac, bo jestes martwy.")
return PLUGIN_HANDLED
}
if(cs_get_user_money(id)<koszt_granatow) {
client_print(id,print_chat,"[Kupno Granatow] Masz za malo kasy ;(")
return PLUGIN_HANDLED
}
give_item(id, "weapon_hegrenade")
give_item(id, "weapon_flashbang")
give_item(id, "weapon_flashbang")
give_item(id, "weapon_smokegrenade")
cs_set_user_money(id,kasa-get_cvar_num("koszt_granatow"))
//cs_set_user_money(id,cs_get_user_money(id)-get_pcvar_num(koszt_hp))
return PLUGIN_HANDLED
}
A w plugin_init:
register_cvar("koszt_granatow","1000")