| InfernaL29 |
12-28-2009 19:10 |
Scripting Help.
So look, im coding a hns shop and i can't get the awp to work for Ts only.
PHP Code:
case 6: // AWP { if (is_user_alive(id) && get_user_team(id) == 1 && !userawp[id]) { ColorChat(id, BLUE, "^x04%s^x01 You need to be alive!", PREFIX); return PLUGIN_HANDLED; } else { if ( get_user_team(id) == 1) { ColorChat(id, BLUE, "^x04%s^x01 You can only buy AWP once a round!", PREFIX); } if ( get_user_team(id) == 2) { ColorChat (id, BLUE, "^x04%s^x01 You cannot buy AWP because you are CT!", PREFIX); } if(userawp[id] > 0) { ColorChat(id, BLUE, "^x04%s^x01 You already own this item!", PREFIX); return PLUGIN_HANDLED; } if(get_pcvar_num(allowawp) == 0) { ColorChat(id, BLUE, "^x04%s^x01 This item is disabled.", PREFIX); return PLUGIN_HANDLED; } new money = fm_get_user_money(id); new cost = get_pcvar_num(awpcost); if(money > cost || money == cost) { fm_set_user_money(id, money - cost); fm_give_item(id, "weapon_awp"); cs_set_weapon_ammo(find_ent_by_owner(1, "weapon_awp", id), 1); userawp[id] = true; ColorChat(id, BLUE, "^x04%s^x01 You purchased an^x03 AWP.", PREFIX); } else { ColorChat(id, BLUE, "^x04%s^x01 You need more^x04 money^x01 to buy this!", PREFIX); } } }
If anyone can help me make this work for Ts only, I will appreciate it. Thanks
|