Raised This Month: $51 Target: $400
 12% 

money for losing team


Post New Thread Reply   
 
Thread Tools Display Modes
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 04-10-2008 , 14:21   Re: money for losing team
Reply With Quote #11

Mine is just a little less advanced than connorr's but it still gets the job done.

Code:
#include <amxmodx> #include <fakemeta> enum CsTeams {     CS_TEAM_UNASSIGNED = 0,     CS_TEAM_T,     CS_TEAM_CT,     CS_TEAM_SPECTATOR }; #define OFFSET_TEAM 114 #define OFFSET_MONEY    115 #define cs_get_user_team(%1) CsTeams:get_pdata_int(%1, OFFSET_TEAM) #define cs_get_user_money(%1) get_pdata_int(%1, OFFSET_MONEY) #define MONEY_EXTRA 1400 #define MONEY_MAX   16000 new g_iMsgMoney; new g_iMaxPlayers; public plugin_init() {     register_plugin("Money For Losers", "0.1", "Exolent");     register_event("SendAudio", "event_SendAudio", "a", "2&%!MRAD_terwin", "2&%!MRAD_ctwin");     g_iMsgMoney = get_user_msgid("Money");     g_iMaxPlayers = get_maxplayers(); } public event_SendAudio() {     new sWinner[9];     read_data(2, sWinner, sizeof(sWinner) - 1);         new CsTeams:iTeam = (sWinner[7] != 'c') ? CS_TEAM_CT : CS_TEAM_T;         new iMoney;     for(new id = 1; id <= g_iMaxPlayers; id++)     {         if(is_user_connected(id) && cs_get_user_team(id) == iTeam)         {             iMoney = cs_get_user_money(id);             if(iMoney >= MONEY_MAX)             {                 continue;             }                         iMoney = min(iMoney + MONEY_EXTRA, MONEY_MAX);             cs_set_user_money(id, iMoney, 1);         }     } } stock cs_set_user_money(index, iMoney, iFlash = 1) {     if(!is_user_connected(index))     {         return 0;     }         set_pdata_int(index, OFFSET_MONEY, iMoney);         message_begin(MSG_ONE_UNRELIABLE, g_iMsgMoney, _, index);     write_long(iMoney);     write_byte(iFlash ? 1 : 0);     message_end();         return 1; }
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!

Last edited by Exolent[jNr]; 04-11-2008 at 07:25.
Exolent[jNr] is offline
Maurice
Senior Member
Join Date: Nov 2006
Location: Netherlands
Old 04-10-2008 , 14:44   Re: money for losing team
Reply With Quote #12

Thanks connorr, but what does this plugin all because i read something about team_advantage_streak.

Maybe it's easier if i tell something about the problem i'm trying to fix.
I've a cs_assault only server wich is for CT much harder as the terrorists to win. To give CT a better win chance i using a roundstart money plugin wich give each player on the server $3600. If a player already have $3600 or more the plugin give nothing so the plugin only helps the losing team so they can spend also $3600 for good weapons and gives a better winning chance.

The negative part of this plugin is that the "pistol round" is gone because the first round the plugin give all players $3600 and quik buyers can even get twice $3600.

It would be really great if there was a plugin that give BEFORE roundstart only the died players from the losing team $3600 and if one of the players already have $3600 or more they get nothing. The reason why alive players from the losing team don't need to receive money is because they are mostly campers or didn't do enough their best to win the round. If this plugin could be realised i would be a very happy person.
__________________
Luck? Luck is only one feeling of amazement concerning a seemingly incidental circumstance which one himself must create.
Maurice is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 04-10-2008 , 15:21   Re: money for losing team
Reply With Quote #13

If the winning team wins X team_advantage_streak rounds in a row, the plugin gives to loosing team X * team_advantage_money $
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Maurice
Senior Member
Join Date: Nov 2006
Location: Netherlands
Old 04-10-2008 , 15:53   Re: money for losing team
Reply With Quote #14

Thanks for the explanation connerr, if i set it to 1 it will disable the feature if i'm right?

Because you know alot about amxx scripting connorr can i ask you for your opinion if the idea in my last post would be possible to make into a plugin because that would for me the ultimate round start money plugin.
__________________
Luck? Luck is only one feeling of amazement concerning a seemingly incidental circumstance which one himself must create.
Maurice is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 04-11-2008 , 01:13   Re: money for losing team
Reply With Quote #15

Yes it can be done.
Waiting this day, you can use my roundstartmoney plugin that will prevent fast buyers.
This plugin works with mp_startmoney :
Attached Files
File Type: sma Get Plugin or Get Source (roundstartmoney.sma - 422 views - 2.0 KB)
__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 11-17-2010 at 02:01.
ConnorMcLeod is offline
Maurice
Senior Member
Join Date: Nov 2006
Location: Netherlands
Old 04-11-2008 , 15:05   Re: money for losing team
Reply With Quote #16

Thanks connerr and X-olent i didnt meantion your post earlier as now. I will test both plugins.
__________________
Luck? Luck is only one feeling of amazement concerning a seemingly incidental circumstance which one himself must create.
Maurice is offline
Maurice
Senior Member
Join Date: Nov 2006
Location: Netherlands
Old 04-11-2008 , 18:47   Re: money for losing team
Reply With Quote #17

I've just tested both plugins and both work perfect! The reason why i've choiced to use connor's roundstartmoney plugin is because with a roundstartmoney below the roundwinbonusmoney ($3600) it don't matters if all players get extra money because in all cases the winning team players get $3600.

X-olent's moneyforlosers plugin make nice distinction between the winning and losing team players but with a low extra rondstartmoney (below $3600) it dont realy matters, it would be a different storry if this plugin also maded distinction between died and living players. After testing with this plugin i noticed the money is given when all players are death from the losing team wichof it isn't editable to give only the died players extra money but nervertheless thanks for the plugin.
__________________
Luck? Luck is only one feeling of amazement concerning a seemingly incidental circumstance which one himself must create.

Last edited by Maurice; 04-11-2008 at 18:51.
Maurice is offline
kobri
Senior Member
Join Date: Oct 2005
Location: Bulgaria
Old 11-16-2010 , 11:36   Re: money for losing team
Reply With Quote #18

Players in my servers have found a bug - using record/stop demo makes the plugin give you money
__________________
Founder of the legendary OptiLAN, MANIA and SECTOR.BG Gaming Communities
Providing everyday fun for over 15000 Bulgarian players!

http://about.me/kobri
kobri is offline
Send a message via Skype™ to kobri
Jelle
[b]MOAR CANDY[/b]
Join Date: Aug 2009
Location: Denmark
Old 11-16-2010 , 13:48   Re: money for losing team
Reply With Quote #19

Because Conner and Exolent has to be so advanced with everything. This should work:

PHP Code:
#include <amxmodx>
#include <cstrike>



public plugin_init()
{
    
register_plugin("Money for losing team""1.0""Jelle")
    
    
register_event("SendAudio""tr_win""a""2&%!MRAD_terwin")
    
register_event("SendAudio""ct_win""a""2&%!MRAD_ctwin")
}

public 
tr_win()
{
    new 
players[32], playerCountiplayer
    get_players
(playersplayerCount"h")
    
    for ( 
0playerCounti++ )
    {
        
player players[i]
        
        if ( 
cs_get_user_team(player) == CS_TEAM_CT )
        {
            
cs_set_user_money(playercs_get_user_money(player) + 1400)
        }
    }
}

public 
ct_win()
{
    new 
players[32], playerCountiplayer
    get_players
(playersplayerCount"h")
    
    for ( 
0playerCounti++ )
    {
        
player players[i]
        
        if ( 
cs_get_user_team(player) == CS_TEAM_T )
        {
            
cs_set_user_money(playercs_get_user_money(player) + 1400)
        }
    }

__________________
No idea what to write here...
Jelle is offline
Send a message via MSN to Jelle
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 11-17-2010 , 02:03   Re: money for losing team
Reply With Quote #20

Quote:
Originally Posted by kobri View Post
Players in my servers have found a bug - using record/stop demo makes the plugin give you money
I have replaced #15 plugin that was the cause of this issue (was quite old plugin).
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 13:23.


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