AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [CSGO] Setting player money doesn't work for me (https://forums.alliedmods.net/showthread.php?t=317888)

D_Doggo 08-03-2019 13:56

[CSGO] Setting player money doesn't work for me
 
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);


OciXCrom 08-03-2019 15:41

Re: [CSGO] Setting player money doesn't work for me
 
This is the AMXX section.

D_Doggo 08-03-2019 17:00

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

Originally Posted by OciXCrom (Post 2661722)
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'.


All times are GMT -4. The time now is 17:30.

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