Raised This Month: $ Target: $400
 0% 

Solved disable money at connection


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ddk
Junior Member
Join Date: May 2017
Old 05-12-2017 , 03:37   disable money at connection
Reply With Quote #1

Hello! how can i disable players receiving mp_startmoney at connection to server and instead give it to them when they spawn. I have bank plugin running, some players keep reconnecting and deposit start money to their bank accounts.

Last edited by ddk; 05-15-2017 at 08:23.
ddk is offline
Str4x3D1x
Member
Join Date: Feb 2014
Old 05-12-2017 , 07:15   Re: disable money at connection
Reply With Quote #2

Code:
client_putinserver
{
//Add code here...
}
__________________
First you learn to read. Then you read to learn.
Str4x3D1x is offline
JusTGo
Veteran Member
Join Date: Mar 2013
Old 05-12-2017 , 07:15   Re: disable money at connection
Reply With Quote #3

mp_startmoney 0 ?
__________________
JusTGo is offline
Str4x3D1x
Member
Join Date: Feb 2014
Old 05-12-2017 , 07:17   Re: disable money at connection
Reply With Quote #4

Quote:
Originally Posted by JusTGo View Post
mp_startmoney 0 ?
That will disable start money overall, i think he wants them to get money once they select team or w/e
No idea how that will help but yeah
__________________
First you learn to read. Then you read to learn.

Last edited by Str4x3D1x; 05-12-2017 at 07:17.
Str4x3D1x is offline
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 05-12-2017 , 08:23   Re: disable money at connection
Reply With Quote #5

I created a new CVAR, mp_spawnmoney.
Code:
#include < amxmodx > #include < cstrike > #include < hamsandwich > new iSpawnMoneyCVAR ; public plugin_init( ) {     register_plugin( "mp_spawnmoney", "1.0", "DoNii" ) ;     RegisterHam( Ham_Spawn, "player", "fw_HamSpawnPost", 1 ) ;         iSpawnMoneyCVAR = register_cvar( "mp_spawnmoney", "1000" ) ;     set_cvar_num( "mp_startmoney", 0 ) ; } public fw_HamSpawnPost( id ) {     if( ! is_user_alive( id ) )     return HAM_IGNORED ;     cs_give_user_money( id, get_pcvar_num( iSpawnMoneyCVAR ) ) ;     return HAM_IGNORED ; } cs_give_user_money( const id, const iAmount ) {     if( ! is_user_connected( id ) )     return -1 ;     cs_set_user_money( id, cs_get_user_money( id ) + iAmount ) ;     return 1 ; }
__________________
edon1337 is offline
ddk
Junior Member
Join Date: May 2017
Old 05-12-2017 , 09:59   Re: disable money at connection
Reply With Quote #6

Quote:
Originally Posted by Str4x3D1x View Post
That will disable start money overall, i think he wants them to get money once they select team or w/e
No idea how that will help but yeah
once they spawn, not just select a team. the idea is that they have to wait instead of instantly getting cash
ddk is offline
ddk
Junior Member
Join Date: May 2017
Old 05-12-2017 , 10:31   Re: disable money at connection
Reply With Quote #7

Quote:
Originally Posted by edon1337 View Post
I created a new CVAR, mp_spawnmoney.
THX, just tested. But even with mp_startmoney 0, im still getting 800$ on connection, any idea how to fix it?

Last edited by ddk; 05-12-2017 at 10:34.
ddk is offline
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 05-12-2017 , 11:48   Re: disable money at connection
Reply With Quote #8

Sorry, my fault, use this https://forums.alliedmods.net/showpo...&postcount=232 and this
Code:
#include < amxmodx > #include < cstrike > #include < hamsandwich > new iSpawnMoneyCVAR ; public plugin_init( ) {     register_plugin( "mp_spawnmoney", "1.0", "DoNii" ) ;     RegisterHam( Ham_Spawn, "player", "fw_HamSpawnPost", 1 ) ;         iSpawnMoneyCVAR = register_cvar( "mp_spawnmoney", "1000" ) ; } public fw_HamSpawnPost( id ) {     if( ! is_user_alive( id ) )     return HAM_IGNORED ;     cs_give_user_money( id, get_pcvar_num( iSpawnMoneyCVAR ) ) ;     return HAM_IGNORED ; } cs_give_user_money( const id, const iAmount ) {     if( ! is_user_connected( id ) )     return -1 ;     cs_set_user_money( id, cs_get_user_money( id ) + iAmount ) ;     return 1 ; }
__________________
edon1337 is offline
ddk
Junior Member
Join Date: May 2017
Old 05-12-2017 , 13:29   Re: disable money at connection
Reply With Quote #9

Thank you.
that other plugin requires Orpheu, maybe there's a way without it...
ddk is offline
kristi
Senior Member
Join Date: Nov 2016
Old 05-12-2017 , 13:45   Re: disable money at connection
Reply With Quote #10

Install Orpheu.
kristi is offline
Send a message via Skype™ to kristi
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 01:13.


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