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

[CSGO] Setting player money doesn't work for me


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
D_Doggo
New Member
Join Date: Aug 2019
Old 08-03-2019 , 17:01   [CSGO] Setting player money doesn't work for me
Reply With Quote #1

Hi, i've been trying to the last 4 hours or so just to get setting player money to work. I've got a plugin that sets up a standard competitive game howevery my plugin decides half times. So mp_halftime 0 is on. This means I
have to set the money of clients every half time back to 800.

Currently the following code isn't working how it's supposed to. What happens is the first time I join the server, my money gets set to 169. However when I play the game and a new round starts, I spawn in and my money doesn't get set, the function does get called.

Code:
HookEvent("player_spawn", onPlayerSpawn);
Code:
public onPlayerSpawn(Handle:event, String:strName[], bool:bDontBroadcast) {
	new client = GetClientOfUserId(GetEventInt(event, "userid"));
	SetEntProp(client, Prop_Send, "m_iAccount", 169);
}
other code found online that DOESN'T work, does the same as described above.

Code:
new client = GetClientOfUserId(GetEventInt(event, "userid"));
new g_iAccount;
g_iAccount = FindSendPropOffs("CCSPlayer", "m_iAccount");
SetEntData(client, g_iAccount, moneyAmount);

Last edited by D_Doggo; 08-03-2019 at 17:02.
D_Doggo is offline
farawayf
Senior Member
Join Date: Jan 2019
Old 08-03-2019 , 17:15   Re: [CSGO] Setting player money doesn't work for me
Reply With Quote #2

hookevent round_start, on callback do client loop then set money
farawayf is offline
eyal282
Veteran Member
Join Date: Aug 2011
Old 08-04-2019 , 11:07   Re: [CSGO] Setting player money doesn't work for me
Reply With Quote #3

Try setting "m_iStartAccount" as well, with the same value.
__________________
I am available to make plugins for pay.

Discord: Eyal282#1334
eyal282 is offline
Indarello
Senior Member
Join Date: Nov 2015
Location: Russia
Old 08-08-2019 , 13:56   Re: [CSGO] Setting player money doesn't work for me
Reply With Quote #4

mp_backup_round_file ""
mp_backup_round_file_last ""
mp_backup_round_file_pattern ""
mp_backup_round_auto "0"
Indarello 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 17:41.


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