Splizes Posted February 19, 2010 Share Posted February 19, 2010 (edited) We were playing bigcity earlier and I found out about votecash from zild3d however, the command was broken and did not work. So therefore I am suggesting that you implement this: (or something else if crosshair wants to rewrite it) import es, playerlib vc_cash = 16000 vc_voted = [] info = es.AddonInfo() info['name'] = "Vote Cash" info['basename'] = "votecash" info['version'] = "0.0" info['author'] = "Splizes" info['url'] = "http://www.hellsgamers.com/" info['description'] = "Gives a pre-defined amount of cash when players vote on it." es.ServerVar(info['basename'], info['version'], info['description']).makepublic() def player_say(ev): global vc_cash, vc_voted if ev['text'] == "votecash" or ev['text'] == "!votecash": user = int(ev['userid']) if user not in vc_voted: VotesNeeded = (len(playerlib.getPlayerList('#human')) / 2) vc_voted.append(user) es.msg('#multi', '#default[#lightgreenVoteCash#default] #lightgreen%s #defaulthas voted to increase all players cash to #lightgreen%s#default! [%s/%s]'%(es.getplayername(user), vc_cash, len(vc_voted), VotesNeeded)) if len(vc_voted) >= VotesNeeded: del vc_voted[:] es.msg('#multi', '#default[#lightgreenVoteCash#default] The vote to increase all players cash to %s has passed, enjoy your cash.'%(vc_cash)) for player in playerlib.getUseridList('#human'): playerlib.getPlayer(player).cash = vc_cash elif user in vc_voted: es.tell(user, '#multi', '#default[#lightgreenVoteCash#default] You have already voted to increase all players cash to #lightgreen%s'% vc_cash) Thanks to f4ithl3ss for helping me test votecash.zip Edited February 19, 2010 by Splizes changed the ammount of votes back to what it should be from testing Quote Link to comment Share on other sites More sharing options...
Splizes Posted February 19, 2010 Author Share Posted February 19, 2010 Uh... is anyone going to look at this? It would make big city much more bearable. Quote Link to comment Share on other sites More sharing options...
ricky2442 Posted February 20, 2010 Share Posted February 20, 2010 Uh... is anyone going to look at this? It would make big city much more bearable. Not just bigcity but any map that requires money such as tron and breakships, this would be a great addition to the minigames server. Quote Link to comment Share on other sites More sharing options...
Splizes Posted February 22, 2010 Author Share Posted February 22, 2010 (edited) Prius requests I restrict the maps this was able to use, so here it is although this is untested, it should work. import es, playerlib vc_cash = 16000 vc_voted = [] vc_maps_allowed = ["mg_breakship_b12", "mg_re_fy_big_city_v10", "tron_jbeta6"] info = es.AddonInfo() info['name'] = "Vote Cash" info['basename'] = "votecash" info['version'] = "0.1" info['author'] = "Splizes" info['url'] = "http://www.hellsgamers.com/" info['description'] = "Gives a pre-defined amount of cash when players vote on it." es.ServerVar(info['basename'], info['version'], info['description']).makepublic() def player_say(ev): global vc_cash, vc_voted, vc_maps_allowed if ev['text'] == "votecash" or ev['text'] == "!votecash": user = int(ev['userid']) if es.server_var["eventscripts_currentmap"] in vc_maps_allowed: if user not in vc_voted: VotesNeeded = (len(playerlib.getPlayerList('#human')) / 2) vc_voted.append(user) es.msg('#multi', '#default[#lightgreenVoteCash#default] #lightgreen%s #defaulthas voted to increase all players cash to #lightgreen%s#default! [%s/%s]'%(es.getplayername(user), vc_cash, len(vc_voted), VotesNeeded)) if len(vc_voted) >= VotesNeeded: del vc_voted[:] es.msg('#multi', '#default[#lightgreenVoteCash#default] The vote to increase all players cash to %s has passed, enjoy your cash.'%(vc_cash)) for player in playerlib.getUseridList('#human'): playerlib.getPlayer(player).cash = vc_cash elif user in vc_voted: es.tell(user, '#multi', '#default[#lightgreenVoteCash#default] You have already voted to increase all players cash to #lightgreen%s'% vc_cash) Edited February 22, 2010 by Splizes Quote Link to comment Share on other sites More sharing options...
Cr(+)sshair Posted February 22, 2010 Share Posted February 22, 2010 (edited) Here's the code I wrote for our NTF Office a while ago...you can build off it =P #include <sourcemod> #include <sdktools> #pragma semicolon 1 new Handle:g_hInterval; new Handle:g_hTimer; #define PLUGIN_VERSION "1.3.3.7" public Plugin:myinfo = { name = "Cr(+)sshair's [HG $]", author = "Cr(+)sshair", description = "Type !$ or !money to receive cash!", version = PLUGIN_VERSION, url = "http://www.hellsgamers.com/" }; new g_iAccount = -1; public OnMapStart() { g_hTimer = CreateTimer(GetConVarInt(g_hInterval) * 1.0, Timer_Show, _, TIMER_REPEAT|TIMER_FLAG_NO_MAPCHANGE); } public OnPluginStart() { g_iAccount = FindSendPropOffs("CCSPlayer", "m_iAccount"); CreateConVar("hg_$_version", PLUGIN_VERSION, "HG$ Version", FCVAR_PLUGIN|FCVAR_SPONLY|FCVAR_REPLICATED); g_hInterval = CreateConVar("hg_timer", "65", ""); RegConsoleCmd( "say", Command_money ); RegConsoleCmd( "say_team", Command_money ); } public Action:Timer_Show(Handle:timer) { PrintToChatAll( "\x04[HG $] Type !$ or !money to fill your wallet!" ); } public Action:Command_money(client, args) { decl String:Said[ 128 ]; GetCmdArgString( Said, sizeof( Said ) - 1 ); StripQuotes( Said ); TrimString( Said ); if( StrEqual( Said, "!$" ) || StrEqual( Said, "!money" ) ) { new iAmount; iAmount = 16000; SetMoney(client, iAmount); } return Plugin_Continue; } public SetMoney(client, amount) { if (g_iAccount != -1) SetEntData(client, g_iAccount, amount); PrintToChat(client, "\x04[HG $] You now have $16000!"); } Edited February 22, 2010 by Cr(+)sshair Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.