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

[HL2] Getting entity data tables?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Bitl
Senior Member
Join Date: Jul 2012
Old 08-23-2014 , 13:22   [HL2] Getting entity data tables?
Reply With Quote #1

Basically I want to change a netprop in the client's m_HL2Local named m_iMoney to a new value, but I have no idea on how to do this.

Quote:
#include <sourcemod>
#include <sdktools>

public Plugin:myinfo =
{
name = "SMOD FIREFIGHT Money Test",
author = "Bitl",
description = "",
version = "1.0",
url = ""
}

public OnPluginStart()
{
RegConsoleCmd("sm_addmoney", Command_addmoney);
RegConsoleCmd("sm_removemoney", Command_removemoney);
RegConsoleCmd("sm_setmoney", Command_setmoney);
}

public Action:Command_addmoney(client, args)
{
new String:arg1[128];
GetCmdArg(1, arg1, 128 );
new cash = StringToInt(arg1);
SetEntProp( client, Prop_Data, "m_iMoney", GetEntProp( client, Prop_Send, "m_iMoney" ) + cash );
}

public Action:Command_removemoney(client, args)
{
new String:arg1[128];
GetCmdArg(1, arg1, 128 );
new cash = StringToInt(arg1);
SetEntProp( client, Prop_Data, "m_iMoney", GetEntProp( client, Prop_Send, "m_iMoney" ) - cash );
}

public Action:Command_setmoney(client, args)
{
new String:arg1[128];
GetCmdArg(1, arg1, 128 );
new cash = StringToInt(arg1);
SetEntProp( client, Prop_Data, "m_iMoney", cash );
}
__________________
My Plugins
Modified Plugins:
Building Spawner
Monster
It's Raining Men!
Tutorials:
Custom Gamemode

I DON'T DO PLUGIN REQUESTS.

Last edited by Bitl; 08-23-2014 at 13:24.
Bitl 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 13:55.


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