AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Money per kill adjust? (https://forums.alliedmods.net/showthread.php?t=308435)

gameplayonline 06-20-2018 07:08

Money per kill adjust?
 
Hello im doign VIP plugin.
I have this code:
Code:

        /* Plugin generated by AMXX-Studio */


#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fun>

#define PLUGIN " VIP"
#define VERSION "1.0"
#define AUTHOR "felippeao"

new kill_bonus, hs_bonus;
new maxplayers;

public plugin_init() {
        register_plugin(PLUGIN, VERSION, AUTHOR)
       
        kill_bonus = register_cvar("money_kill_bonus","450")
        hs_bonus = register_cvar("money_hs_bonus","500")
        register_event("DeathMsg","death_msg","a")       
        // Add your code here...
}

public death_msg()
{
       
        new attacker = read_data( 1 )
        new headshot = read_data(3)
       
        if (get_user_flags(attacker) & ADMIN_LEVEL_H & read_data(1)<=maxplayers && read_data(1) && read_data(1)!=read_data(2))
        {
                new money = read_data(2)
                if(headshot)
                {
                        money += get_pcvar_num(hs_bonus)
                        cs_set_user_money(attacker,cs_get_user_money(attacker) + money)
                        client_print(read_data(1), print_chat, "[VIP] %d got %d money for kill",read_data(1), get_pcvar_num(hs_bonus))
                }
                else
                {
                        cs_set_user_money(attacker,cs_get_user_money(attacker) + get_pcvar_num(kill_bonus))
                        client_print(read_data(1), print_chat, "[VIP] %d got %d money for kill",read_data(1), get_pcvar_num(kill_bonus))
                }
        }
}
        }

Im getting sometimes 802$ per kill... Why? Normal is 300 and my cvar is 450 bonus i think it must be 750 but im getting 802

OciXCrom 06-20-2018 07:48

Re: Money per kill adjust?
 
Because the genius who made the plugin made the amount of money to be added to the victim's id which can be any number from 1 to 32.

PHP Code:

new money read_data(2


maqi 06-20-2018 07:56

Re: Money per kill adjust?
 
Lovely :D

gameplayonline 07-01-2018 09:04

Re: Money per kill adjust?
 
Thanks

Bugsy 07-01-2018 09:08

Re: Money per kill adjust?
 
https://forums.alliedmods.net/showthread.php?t=306378


All times are GMT -4. The time now is 12:41.

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