Skocz do zawartości

Nowy szablon forum

mygo.pl

Stworzyliśmy dla Was nowy wygląd forum. Z pewnością znajdziesz rzeczy, które wg Ciebie mogą zostać zmienione - wspomnij o tym w specjalnym wątku.

Czytaj więcej

Jak założyć własną sieć

serwerów CS

Zastanawiasz się nad prowadzeniem własnej sieci serwerów? Przeczytaj podstawowe informacje, na które należy zwrócić uwagę, przy takim projekcie.

Czytaj więcej

Tworzymy spis sieci

dodaj swoją

Dodaj sieć do której należysz, pozwoli to na promocję i budowę ogólnopolskiej bazy sieci CS.

Czytaj więcej

RSSMoney Manager v1.0


MYGO.pl
 Udostępnij

Rekomendowane odpowiedzi

  • RSSy
For Counter-Strike 1.6 and Condition-Zero.

Credits:
xPaw - set money
Bugsy - get players + command automation + Infinite money
Rqoua - get user team
SonicSonedit - round count
SnoW - bonus control
kketan77 - get roundend events
ConnorMcLeod - rewards per kill


Description:

This plugin allows you to control various functions related to in-game money.

Includes:

value obtained by killing enemies;

value obtained by killing enemies with headshot;

value obtained by killing teammates;

first round money (works normally when restarting rounds);

starting money for each round (does not interfere with the function of the first round);

bonus earned by each team on winning or losing the round (will be received in the same round completed);

Infinite money.


For each command (except reward per kill), you can choose which team will be affected.

You can use negative values, like -16000 in each function.


Commands (By default, all functions are disabled):

mm - will show all the functions available on the console.

mm_kill_money_enabled - activates the earn / kill functions below:

mm_killmoney - reward for killing enemies. Default value: 300

mm_killmoney_head - reward for killing enemies in the head. Default value: 300

mm_killmoney_team - reward for killing teammates. Default value: -3000

mm_bonus_enabled - activates the functions for bonus conditions below:

mm_bonus_win_t - bonus earned by terrorists for winning the round. Default value: 3000

mm_bonus_win_ct - bonus earned by counter-terrorists for winning the round. Default value: 3000

mm_bonus_lose_t - bonus earned by terrorists when they lose the round. Default value: 1000

mm_bonus_lose_ct - bonus earned by counter-terrorists when they lose the round. Default value: 1000

mm_first_round_enabled - activates money functions of the first round:

mm_first_round_t - first round money amount for terrorists. Default value: 800

mm_first_round_ct - first round money amount for counter-terrorists. Default value: 800

mm_every_round_enabled - activates money functions for each round:

mm_every_round_t - starting money for each round for terrorists. Default value: 16000

mm_every_round_ct - starting money for each round for counter-terrorists. Default value: 16000

mm_Infinite_enabled - activates the functions of Infinite money below (just type and press enter):

mm_Infinite - infinite money for both teams.

mm_Infinite_t - infinite money for terrorists only.

mm_Infinite_ct - infinite money for counter-terrorists only.

Notes:

You can use values between -1000000000 and 1000000000, however when killing enemies or buying if the value was in 1000000000 it will return to 16000, except for Infinite money.

Bonus values are obtained when completing the round.

A commandmenu has been created especially for the plugin, so you can use it more quickly and easily (PRESS "H"). See the photos below:

68747470733a2f2f64726976652e676f6f676c65
68747470733a2f2f64726976652e676f6f676c65
68747470733a2f2f64726976652e676f6f676c65
68747470733a2f2f64726976652e676f6f676c65
68747470733a2f2f64726976652e676f6f676c65
68747470733a2f2f64726976652e676f6f676c65
68747470733a2f2f64726976652e676f6f676c65


Software used:

Sublime Text v3.2

Code:

Code:

/*
        Money Manager - AMX Mod X script. Copyright © 2020, WATCH_DOGS UNITED

        This plugin is free software: you can redistribute it and/or modify
        it under the terms of the GNU General Public License as published by
        the Free Software Foundation, either version 3 of the License, or
        (at your option) any later version.

        This program is distributed in the hope that it will be useful,
        but WITHOUT ANY WARRANTY; without even the implied warranty of
        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
        GNU General Public License for more details.

        If you do not know the terms of the GPLv3 you can consult
        it at <https://www.gnu.org/licenses/gpl-3.0.html>

        Credits:
        xPaw        - set money
        Bugsy        - get players + command automation + Infinite money
        Rqoua        - get user team
        SonicSonedit - round count
        SnoW        - bonus control
        kketan77    - get roundend events
        ConnorMcLeod - rewards per kill

        PRESS "MM" ON THE CONSOLE TO GET THE LIST OF COMMANDS.
*/
        #include <amxmisc>
        #include <cstrike>
        #include <fakemeta_util>
        #include <hamsandwich>

        #define Money_Amount 1
        #define IsPlayer(%1)        ( 1 <= %1 <= g_iMaxPlayers )
        #define XTRA_OFS_PLAYER 5
        #define m_iAccount 115
        #define cs_set_money_value(%1,%2)        set_pdata_int(%1, m_iAccount, %2, XTRA_OFS_PLAYER)

        const MoneyAmount = 1000000;

        new bool:g_bmm_Infinite, bool:g_bmm_Infinite_t , bool:g_bmm_Infinite_ct

        new g_iMaxPlayers
        new g_pcvarMoneyControl
        new g_pcvarKillMoney
        new g_pcvarTkMoney
        new g_pcvarKillMoneyHs
        new g_iNewMoney
        new g_iMsgHookMoney
        new gmsgMoney
        new round_number = -1
        new g_pcvar_mm_Infinite
        new g_pcvar_mm_bonus
        new g_pcvar_mm_bonus_win_t
        new g_pcvar_mm_bonus_win_ct
        new g_pcvar_mm_bonus_lose_t
        new g_pcvar_mm_bonus_lose_ct
        new g_pcvar_mm_first_round
        new g_pcvar_mm_first_round_t;
        new g_pcvar_mm_first_round_ct;
        new g_pcvar_mm_every_round
        new g_pcvar_mm_every_round_t;
        new g_pcvar_mm_every_round_ct;

public plugin_init()
{
        register_plugin( "Money Manager" , "1.0" , "WATCH_DOGS UNITED" );

        register_event("DeathMsg", "Kill_Reward", "a")
        g_iMaxPlayers = get_maxplayers()
        gmsgMoney = get_user_msgid("Money")

        RegisterHam(Ham_Spawn, "player", "starting_money", 1);

        register_event("TextMsg", "event_game_restart", "a", "2=#Game_Commencing", "2=#Game_will_restart_in")
        register_event( "Money" , "Infinite_money" , "be" );

        register_logevent("bonus_t" , 6, "3=Terrorists_Win", "3=Target_Bombed")
        register_logevent("bonus_ct", 6, "3=CTs_Win", "3=All_Hostages_Rescued")

        g_pcvarMoneyControl = register_cvar("mm_kill_money_enabled", "1")
        g_pcvarKillMoney = register_cvar("mm_killmoney", "300")
        g_pcvarKillMoneyHs = register_cvar("mm_killmoney_head", "300")
        g_pcvarTkMoney = register_cvar("mm_killmoney_team", "-3000")
        g_pcvar_mm_bonus = register_cvar( "mm_bonus_enabled" , "0" );
        g_pcvar_mm_bonus_win_t = register_cvar( "mm_bonus_win_t" , "3000" );
        g_pcvar_mm_bonus_win_ct = register_cvar( "mm_bonus_win_ct" , "3000" );
        g_pcvar_mm_bonus_lose_t = register_cvar( "mm_bonus_lose_t" , "1000" );
        g_pcvar_mm_bonus_lose_ct = register_cvar( "mm_bonus_lose_ct" , "1000" );
        g_pcvar_mm_first_round = register_cvar( "mm_first_round_enabled" , "0" );
        g_pcvar_mm_first_round_t = register_cvar( "mm_first_round_t" , "800" );
        g_pcvar_mm_first_round_ct = register_cvar( "mm_first_round_ct" , "800" );
        g_pcvar_mm_every_round = register_cvar( "mm_every_round_enabled" , "0" );
        g_pcvar_mm_every_round_t = register_cvar( "mm_every_round_t" , "16000" );
        g_pcvar_mm_every_round_ct = register_cvar( "mm_every_round_ct" , "16000" );
        g_pcvar_mm_Infinite = register_cvar( "mm_Infinite_enabled" , "0" );
        register_concmd( "mm_Infinite" , "enable_mm_Infinite" );
        register_concmd( "mm_Infinite_t" , "enable_mm_Infinite_t" );
        register_concmd( "mm_Infinite_ct" , "enable_mm_Infinite_ct" );
        register_concmd( "mm", "show_cvars" );
}

public show_cvars(id)
{
        client_print(id, print_console, " " );
        client_print(id, print_console, "============== Money Manager - Command list: ==============" );
        client_print(id, print_console, " " );
        client_print(id, print_console, "mm_kill_money_enabled  -  activates the earn / kill functions below:" );
        client_print(id, print_console, " " );
        client_print(id, print_console, "mm_killmoney  -  reward for killing enemies" );
        client_print(id, print_console, "mm_killmoney_head  -  reward for killing enemies in the head" );
        client_print(id, print_console, "mm_killmoney_team  -  reward for killing teammates" );
        client_print(id, print_console, " " );
        client_print(id, print_console, "mm_bonus_enabled  -  activates the functions for bonus conditions below:" );
        client_print(id, print_console, " " );
        client_print(id, print_console, "mm_bonus_win_t  -  bonus earned by terrorists for winning the round" );
        client_print(id, print_console, "mm_bonus_win_ct  -  bonus earned by counter-terrorists for winning the round" );
        client_print(id, print_console, "mm_bonus_lose_t  -  bonus earned by terrorists when they lose the round" );
        client_print(id, print_console, "mm_bonus_lose_ct  -  bonus earned by counter-terrorists when they lose the round" );
        client_print(id, print_console, " " );
        client_print(id, print_console, "mm_first_round_enabled  -  activates money functions of the first round:" );
        client_print(id, print_console, " " );
        client_print(id, print_console, "mm_first_round_t  -  first round money amount for terrorists" );
        client_print(id, print_console, "mm_first_round_ct  -  first round money amount for counter-terrorists" );
        client_print(id, print_console, " " );
        client_print(id, print_console, "mm_every_round_enabled  -  activates money functions for each round:" );
        client_print(id, print_console, " " );
        client_print(id, print_console, "mm_every_round_t  -  starting money for each round for terrorists" );
        client_print(id, print_console, "mm_every_round_ct  -  starting money for each round for counter-terrorists" );
        client_print(id, print_console, " " );
        client_print(id, print_console, "mm_Infinite_enabled  -  activates the functions of infinite money:" );
        client_print(id, print_console, " " );
        client_print(id, print_console, "mm_Infinite  -  infinite money for both teams" );
        client_print(id, print_console, "mm_Infinite_t  -  infinite money for terrorists" );
        client_print(id, print_console, "mm_Infinite_ct  -  infinite money for counter-terrorists" );
        client_print(id, print_console, " " );
}

public enable_mm_Infinite()
{
        g_bmm_Infinite = true;
        g_bmm_Infinite_t = false;
        g_bmm_Infinite_ct = false;
}

public enable_mm_Infinite_t()
{
        g_bmm_Infinite = false;
        g_bmm_Infinite_t = true;
        g_bmm_Infinite_ct = false;
}

public enable_mm_Infinite_ct()
{
        g_bmm_Infinite = false;
        g_bmm_Infinite_t = false;
        g_bmm_Infinite_ct = true;
}

public starting_money( id )
{
        set_task( 0.0 , "money_every_round" );
        set_task( 0.0 , "money_first_round" );
}

public money_every_round()
{
        if ( !get_pcvar_num( g_pcvar_mm_every_round ) )
                return;

        new iPlayers[ 32 ] , iNum , iPlayer;
       
        get_players( iPlayers , iNum , "a" );
       
        for ( new i = 0 ; i < iNum ; i++ )
        {
                iPlayer = iPlayers[ i ];
               
                new iMoney_every_round_t = clamp( get_pcvar_num( g_pcvar_mm_every_round_t ), -1000000000, 1000000000 );
                new iMoney_every_round_ct = clamp( get_pcvar_num( g_pcvar_mm_every_round_ct ), -1000000000, 1000000000 );

                if(get_user_team(iPlayer) == 1)
                {
                        cs_set_user_money( iPlayer , iMoney_every_round_t );
                }
                if(get_user_team(iPlayer) == 2)
                {
                        cs_set_user_money( iPlayer , iMoney_every_round_ct );
                }
        }
}

public bonus_t()
{
        if ( !get_pcvar_num( g_pcvar_mm_bonus ) )
                return;

        new iPlayers[ 32 ] , iNum , iPlayer;
       
        get_players( iPlayers , iNum , "a" );
       
        for ( new i = 0 ; i < iNum ; i++ )
        {
                iPlayer = iPlayers[ i ];
               
                new bonus = cs_get_user_money(iPlayer);

                if(get_user_team(iPlayer) == 1)
                {
                        cs_set_user_money( iPlayer , bonus + clamp( get_pcvar_num( g_pcvar_mm_bonus_win_t ), -1000000000, 1000000000 ) );
                }
                if(get_user_team(iPlayer) == 2)
                {
                        cs_set_user_money( iPlayer , bonus + clamp( get_pcvar_num( g_pcvar_mm_bonus_lose_ct ), -1000000000, 1000000000 ) );
                }
        }
}

public bonus_ct()
{
        if ( !get_pcvar_num( g_pcvar_mm_bonus ) )
                return;

        new iPlayers[ 32 ] , iNum , iPlayer;
       
        get_players( iPlayers , iNum , "a" );
       
        for ( new i = 0 ; i < iNum ; i++ )
        {
                iPlayer = iPlayers[ i ];
               
                new bonus = cs_get_user_money(iPlayer);

                if(get_user_team(iPlayer) == 2)
                {
                        cs_set_user_money( iPlayer , bonus + clamp( get_pcvar_num( g_pcvar_mm_bonus_win_ct ), -1000000000, 1000000000 ) );
                }
                if(get_user_team(iPlayer) == 1)
                {
                        cs_set_user_money( iPlayer , bonus + clamp( get_pcvar_num( g_pcvar_mm_bonus_lose_t ), -1000000000, 1000000000 ) );
                }
        }
}

public money_first_round()
{
        if ( !get_pcvar_num( g_pcvar_mm_first_round ) )
                return;

        round_number++

        new iPlayers[ 32 ] , iNum , iPlayer;
       
        get_players( iPlayers , iNum , "a" );
       
        for ( new i = 0 ; i < iNum ; i++ )
        {

                if(round_number< 2)
                {
                iPlayer = iPlayers[ i ];
               
                new iMoney_first_round_t = clamp( get_pcvar_num( g_pcvar_mm_first_round_t ), -1000000000, 1000000000 );
                new iMoney_first_round_ct = clamp( get_pcvar_num( g_pcvar_mm_first_round_ct ), -1000000000, 1000000000 );

                if(get_user_team(iPlayer) == 1)
                {
                        cs_set_user_money( iPlayer , iMoney_first_round_t );
                }
                if(get_user_team(iPlayer) == 2)
                {
                        cs_set_user_money( iPlayer , iMoney_first_round_ct );
                }
                }
        }
}

public event_game_restart()
{
        round_number= 0
}

public Infinite_money( id )
{
        if ( !get_pcvar_num( g_pcvar_mm_Infinite ) )
                return;

        if ( g_bmm_Infinite )
        {

        if(get_user_team(id) == 1)
        {
        cs_set_user_money( id , MoneyAmount , 0 );
        }
        if(get_user_team(id) == 2)
        {
        cs_set_user_money( id , MoneyAmount , 0 );
        }
        }

        if ( g_bmm_Infinite_t )
        {

        if(get_user_team(id) == 1)
        {
        cs_set_user_money( id , MoneyAmount , 0 );
        }
        }

        if ( g_bmm_Infinite_ct )
        {

        if(get_user_team(id) == 2)
        {
        cs_set_user_money( id , MoneyAmount , 0 );
        }
        }
}

enum
{       
        DeathMsg_KillerID = 1, // byte
        DeathMsg_VictimID, // byte
        DeathMsg_IsHeadshot, // byte
        DeathMsg_TruncatedWeaponName // string
}

public Kill_Reward()
{
        if ( !get_pcvar_num( g_pcvarMoneyControl ) )
                return;

        new iKiller = read_data(DeathMsg_KillerID)
        if( IsPlayer(iKiller)&& is_user_connected(iKiller) )
        {
                new iVictim = read_data(DeathMsg_VictimID)
                if( iVictim != iKiller )
                {
                                g_iNewMoney = clamp
                                                                (
                                                                        cs_get_user_money(iKiller)+ get_pcvar_num( cs_get_user_team(iVictim)== cs_get_user_team(iKiller)? g_pcvarTkMoney : (read_data(DeathMsg_IsHeadshot)? g_pcvarKillMoneyHs : g_pcvarKillMoney) ),
                                                                        0
                                                                )
                                g_iMsgHookMoney = register_message(gmsgMoney, "Message_Money")
                }
        }
}

public Message_Money(iMsgId, iMsgDest, id)
{
        unregister_message(gmsgMoney, g_iMsgHookMoney)
        cs_set_money_value(id, g_iNewMoney)
        set_msg_arg_int(Money_Amount, ARG_LONG, g_iNewMoney)
}


Attached Files
File Type: sma Get Plugin or Get Source (money_manager.sma - 11.0 KB)
File Type: zip optional_commandmenu.zip (2.6 KB)

Przeczytaj cały wpis

Odnośnik do komentarza
Udostępnij na innych stronach

Gość
Ten temat został zamknięty. Brak możliwości dodania odpowiedzi.
 Udostępnij

  • Ostatnio przeglądający   0 użytkowników

    • Brak zarejestrowanych użytkowników przeglądających tę stronę.
×
×
  • Dodaj nową pozycję...