Raised This Month: $32 Target: $400
 8% 

About netmessages


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Naydef
Senior Member
Join Date: Dec 2015
Location: Doom Town, Nevada
Old 06-20-2018 , 11:23   About netmessages
Reply With Quote #1

Hello everyone

I was wondering if i can send or receive netmessages to/from clients using Sourcemod(without extensions). I need this functionality for a special plugin, which pauses the game. More specifically
PHP Code:
#define    svc_SetPause        11        // tells client if server paused or unpaused 
If someone has any idea, then comment please.
__________________
My plugins:
*None for now*


Steam:
naydef

Last edited by Naydef; 06-20-2018 at 11:24.
Naydef is offline
backwards
AlliedModders Donor
Join Date: Feb 2014
Location: USA
Old 06-20-2018 , 15:39   Re: About netmessages
Reply With Quote #2

Just use the following if you need to freeze players mouse controls and movement

PHP Code:
SetEntityFlags(client, (GetEntityFlags(client) |= FL_FROZEN)); //On
SetEntityFlags(client, (GetEntityFlags(client) &= ~FL_FROZEN)); //Off 
__________________
I highly recommend joining the SourceMod Discord Server for real time support.
backwards is offline
Naydef
Senior Member
Join Date: Dec 2015
Location: Doom Town, Nevada
Old 06-21-2018 , 07:17   Re: About netmessages
Reply With Quote #3

Quote:
Originally Posted by 1337norway View Post
Just use the following if you need to freeze players mouse controls and movement

PHP Code:
SetEntityFlags(client, (GetEntityFlags(client) |= FL_FROZEN)); //On
SetEntityFlags(client, (GetEntityFlags(client) &= ~FL_FROZEN)); //Off 
Your method looks promising, but animations in First Person are still playing and player can change weapon slots(i think changing weapons is predicted and cannot be blocked without animation plays client-side). By the way, the game is TF2
__________________
My plugins:
*None for now*


Steam:
naydef

Last edited by Naydef; 06-21-2018 at 07:20.
Naydef is offline
backwards
AlliedModders Donor
Join Date: Feb 2014
Location: USA
Old 06-21-2018 , 12:28   Re: About netmessages
Reply With Quote #4

It's possible you may still be able to do that in-game while the normal svc_setpause message is set. I would test the normal method with sv_pauseable 1 and issuing the pause command from the client. It's possible it's an oversight and pause wasn't fully placed into the game as it originally worked in previous source engine games. If that is the case then using the method you originally asked about would still have the issues of allowing weapon switches and animations to happen.
__________________
I highly recommend joining the SourceMod Discord Server for real time support.
backwards is offline
Ilusion9
Veteran Member
Join Date: Jun 2018
Location: Romania
Old 06-21-2018 , 12:41   Re: About netmessages
Reply With Quote #5

if it's pausing the game then all players must be on freeze
use sm_rcon pause

or

PHP Code:
GameRules_SetProp("m_bFreezePeriod"1); 
this is working for CS:GO
Ilusion9 is offline
Naydef
Senior Member
Join Date: Dec 2015
Location: Doom Town, Nevada
Old 06-21-2018 , 15:45   Re: About netmessages
Reply With Quote #6

Well, the game is TF2, anyway what i want to make is a plugin which pauses SPECIFIC player(s) without side effects caused by the prediction. This reminds me that there is cvar which controlles whether the client predicts entities or not. I might try combining FL_FROZEN method and the prediction cvar changing in order to freeze player without prediction messing with my things.
Anyway, i still want to see the possibility of receiving/sending netmesssages using the Sourcemod API, it gives some new opportunities(at least for me) when making plugins.
__________________
My plugins:
*None for now*


Steam:
naydef
Naydef is offline
backwards
AlliedModders Donor
Join Date: Feb 2014
Location: USA
Old 06-21-2018 , 17:04   Re: About netmessages
Reply With Quote #7

I don't believe there's a native way to write directly to the bit buffer stream sent out to clients within sourcemod. They only seem to have an interface for user messages which just calls the engine functions for begin and end message. You most likely would need to write a sourcemod extension to do this by obtaining the clients net channels and writing the created messages for svc_ that way.
__________________
I highly recommend joining the SourceMod Discord Server for real time support.
backwards 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 10:53.


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