Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- This is just an example of how new human class can be registered using existing BB Human classes Api
- */
- #include <amxmodx>
- #include <fun>
- #include <cstrike>
- native bb_is_user_zombie(client);
- native bb_register_hclass(const cName[], const cDesc[], const cMenuName[], iClassFlag);
- forward bb_human_spawned(client, class);
- new current_class[33], MONEYMAKER
- public plugin_init() {
- register_plugin("BB Human Class Sample", "1.0", "Mega")
- register_event("DeathMsg", "eDeath", "ade");
- MONEYMAKER = bb_register_hclass("Moneymaker", "\r[\dGets bonus money when kills an enemy\r]", "\rMoneymaker", ADMIN_ALL)
- }
- public eDeath() {
- new id = read_data(2);
- new attacker = read_data(1);
- if(attacker != id && !bb_is_user_zombie(attacker) && current_class[attacker] == MONEYMAKER)
- {
- cs_set_user_money(id, cs_get_user_money(id) + 3000) // primer
- }
- }
- public bb_human_spawned(id, class) {
- current_class[id] = class
- if(current_class[id] == MONEYMAKER) {
- set_user_health(id, get_user_health(id) + 20) // primer
- }
- }
- public client_putinserver(id) {
- current_class[id] = 0
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement