Raised This Month: $ Target: $400
 0% 

[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 , 13:56   [CSGO] Setting player money doesn't work for me
Reply With Quote #1

EDIT: Wrong subforum sorry

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:01.
D_Doggo is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 08-03-2019 , 15:41   Re: [CSGO] Setting player money doesn't work for me
Reply With Quote #2

This is the AMXX section.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
D_Doggo
New Member
Join Date: Aug 2019
Old 08-03-2019 , 17:00   Re: [CSGO] Setting player money doesn't work for me
Reply With Quote #3

Quote:
Originally Posted by OciXCrom View Post
This is the AMXX section.
Ugh i'm sorry I've literally been so frustrated with this, I didn't even care to check what type of
'scripting help'.
D_Doggo is offline
Reply


Thread Tools
Display Modes

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:30.


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