Monthly Target: $400 Donations: $76
 19% 

SendProxy Manager


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Afronanny
Veteran Member
Join Date: Aug 2009
Old 10-16-2011 , 22:17   SendProxy Manager
Reply With Quote #1

SendProxy Manager

SendVar Proxies allow you to send netprop values to clients without actually changing them on the server. If you've coded with SDKHooks before, this should be easy to use, as I designed it to be very similar to SDKHooks. This extension only works on and is only supported on the following engines: ep2, ep2v, and css.

Download (1.1.3): removed
or view the source removed

Here's some example code to get you started.

PHP Code:
#include <sourcemod>
#include <sendproxy>

public OnPluginStart()
{
    
RegConsoleCmd("test_hook"Command_TestHook);
}

public 
Action:Command_TestHook(clientargs)
{
    
SendProxy_Hook(client"m_iTeamNum"Prop_IntProxyCallback);
    return 
Plugin_Handled;
}

public 
Action:ProxyCallback(entity, const String:propname[], &iValueelement)
{
    
//Set iValue to whatever you want to send to clients
    
iValue 3;
    return 
Plugin_Changed;

The proxy callback prototype varies for the type of prop you are proxying:
PHP Code:
funcenum SendProxyCallback
{
    
Action:public(entity, const String:PropName[], &iValueelement), //Prop_Int
    
Action:public(entity, const String:PropName[], &Float:flValueelement), //Prop_Float
    
Action:public(entity, const String:PropName[], String:modifiedValue[4096], element), //Prop_String
    
Action:public(entity, const String:PropName[], Float:vecValues[3], element), //Prop_Vector
}; 
The currently supported types are:
Code:
enum SendPropType {
    Prop_Int = 0,
    Prop_Float = 1,
    Prop_String = 2,
    //Prop_Array = 3, //Don't use yet, not fully implemented
    Prop_Vector = 4,
    Prop_Max
};
If you return Plugin_Changed in a callback, the extension will mark the edict as changed to avoid console spam from the engine. The actual values of the prop are passed through iValue, flValue, modifiedValue, and vecValues, which you can change as you see fit.

If you manage to crash this, please do provide me with some debug data and the source to whatever crashed it so that I may fix said crash as quickly as possible.

glhfducksducksducksducksducksducksducksducks

Last edited by asherkin; 03-01-2015 at 11:45.
Afronanny is offline
psychonic

BAFFLED
Join Date: May 2008
Old 10-16-2011 , 22:33   Re: SendProxy Manager
Reply With Quote #2

captioncaptioncaption
psychonic is offline
KyleS
SourceMod Plugin Approver
Join Date: Jul 2009
Location: Segmentation Fault.
Old 10-17-2011 , 03:24   Re: SendProxy Manager
Reply With Quote #3

L 10/16/2011 - 19:26:49: [SM] Native "SendProxy_Hook" reported: Could not find prop m_iHealth in sendtable DT_CSPlayer

Just so it doesn't get lost.
KyleS is offline
GoD-Tony
Veteran Member
Join Date: Jul 2005
Old 10-17-2011 , 05:06   Re: SendProxy Manager
Reply With Quote #4

This looks useful.

Quote:
Originally Posted by KyleS View Post
[SM] Native "SendProxy_Hook" reported: Could not find prop m_iHealth in sendtable DT_CSPlayer
I get the same error using the example posted.
__________________
GoD-Tony is offline
Despirator
Senior Member
Join Date: Jun 2011
Location: Kazakhstan ->Shymkent
Old 10-17-2011 , 05:21   Re: SendProxy Manager
Reply With Quote #5

same for me

Last edited by Despirator; 10-17-2011 at 08:07.
Despirator is offline
McFlurry
Veteran Member
Join Date: Mar 2010
Location: RemoveEdict(0);
Old 10-17-2011 , 09:47   Re: SendProxy Manager
Reply With Quote #6

Sounds very useful.
__________________
McFlurry is offline
Send a message via Skype™ to McFlurry
KyleS
SourceMod Plugin Approver
Join Date: Jul 2009
Location: Segmentation Fault.
Old 10-17-2011 , 10:53   Re: SendProxy Manager
Reply With Quote #7

Quote:
Originally Posted by GoD-Tony View Post
I get the same error using the example posted.
While I'm not completely sure, I think you can detect the "Shoot on Crits" hack(s) with this by hooking the prop (I could also be insane). This has so many use cases it isn't even funny.
KyleS is offline
Afronanny
Veteran Member
Join Date: Aug 2009
Old 10-17-2011 , 13:03   Re: SendProxy Manager
Reply With Quote #8

Fixed your error (Could not find prop m_iHealth in sendtable DT_CSPlayer) hopefully. It now searches all datatables within datatables for the prop you want. Redownload for the updated version.

Also it handles client disconnects now, so you don't need to manually unhook it for client disconnects.
captioncaption

\\
captioncaption

Last edited by Afronanny; 10-17-2011 at 13:24.
Afronanny is offline
Afronanny
Veteran Member
Join Date: Aug 2009
Old 10-17-2011 , 19:21   Re: SendProxy Manager
Reply With Quote #9

Updated (1.0.3).

The integer and float SendProp values are now passed through iValue and flValue in the callback.
caption
Afronanny is offline
Afronanny
Veteran Member
Join Date: Aug 2009
Old 10-18-2011 , 01:46   Re: SendProxy Manager
Reply With Quote #10

Updated again (1.0.4)

Fixed crashes related to plugin unloading/reloading.
caption
Afronanny 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 12:54.


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