Raised This Month: $ Target: $400
 0% 

Function call


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ot_207
Veteran Member
Join Date: Jan 2008
Location: Romania The Love Country
Old 06-24-2010 , 08:05   Function call
Reply With Quote #1

I am interested in the function that is called when a cvar that has the FCVAR_SERVER flag is changed on the server. The function sends players info about the cvar change. Does anybody know about it?
__________________
My approved plug-ins | Good for newbies! | Problems?

Back, will come around when I have time.
ot_207 is offline
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 06-24-2010 , 08:06   Re: Function call
Reply With Quote #2

There is none
__________________
xPaw is offline
ot_207
Veteran Member
Join Date: Jan 2008
Location: Romania The Love Country
Old 06-24-2010 , 08:20   Re: Function call
Reply With Quote #3

Quote:
Originally Posted by xPaw View Post
There is none
But there must be something that the server does to inform players about cvar change. A message maybe?
__________________
My approved plug-ins | Good for newbies! | Problems?

Back, will come around when I have time.
ot_207 is offline
GXLZPGX
Veteran Member
Join Date: Sep 2009
Old 06-24-2010 , 11:51   Re: Function call
Reply With Quote #4

Quote:
Originally Posted by ot_207 View Post
But there must be something that the server does to inform players about cvar change. A message maybe?
AmxModX only displays what the cvar has changed to. You cannot make it display a message to the player when it happens.
__________________
Currently accepting payment US DOLLARS ONLY for custom plugins, contact me through PM.

Last edited by GXLZPGX; 06-24-2010 at 11:54.
GXLZPGX is offline
grimvh2
Veteran Member
Join Date: Nov 2007
Location: Fishdot Nation
Old 06-24-2010 , 12:15   Re: Function call
Reply With Quote #5

Quote:
Originally Posted by GXLZPGX View Post
AmxModX only displays what the cvar has changed to. You cannot make it display a message to the player when it happens.
So not true, it only displays when u use amx_cvar.
__________________
I am out of order!
grimvh2 is offline
ot_207
Veteran Member
Join Date: Jan 2008
Location: Romania The Love Country
Old 06-24-2010 , 12:26   Re: Function call
Reply With Quote #6

I am interested in functions that can be hooked with orpheu not messages that print that the x cvar has changed.
__________________
My approved plug-ins | Good for newbies! | Problems?

Back, will come around when I have time.
ot_207 is offline
GXLZPGX
Veteran Member
Join Date: Sep 2009
Old 06-24-2010 , 12:49   Re: Function call
Reply With Quote #7

Quote:
Originally Posted by grimvh2 View Post
So not true, it only displays when u use amx_cvar.
You obviously haven't had administrative rights on any server before. Please try not to talk unless you know what you're talking about. It displays a message no matter if you use:

amx_cvar cvar_name value

Or if you go into amxmodmenu -> plugin cvars and change it.


Quote:
Originally Posted by ot_207 View Post
I am interested in functions that can be hooked with orpheu not messages that print that the x cvar has changed.
And I haven't yet come to far with Orpheu. Orpheu is very powerful, I'm sure their is a way.
__________________
Currently accepting payment US DOLLARS ONLY for custom plugins, contact me through PM.

Last edited by GXLZPGX; 06-24-2010 at 12:51.
GXLZPGX is offline
joropito
AlliedModders Donor
Join Date: Mar 2009
Location: pfnAddToFullPack
Old 06-24-2010 , 16:04   Re: Function call
Reply With Quote #8

OT, check at Cvar_DirectSet() function.

It does the following depending on cvar flags:

PHP Code:
            Log_Printf("Server cvar \"%s\" = \"%s\"\n", *(_DWORD *)a2);
            
SV_BroadcastPrintf("\"%s\" changed to \"%s\"\n", *(_DWORD *)a2); 
Here's the code:

PHP Code:

void __usercall Cvar_DirectSet
(long double a1<st0>, int a2char *a3)
{
  
char *v3// edi@1
  
char *v4// ecx@4
  
char *v5// esi@4
  
int v6// esi@11
  
int v7// ST24_4@13
  
int v8// eax@13
  
char v9// al@13
  
int v10// eax@14
  
char *v11// edx@20
  
int v12// eax@20
  
int v13// eax@24
  
int v14// eax@24
  
char v15// [sp+10h] [bp-40Ch]@4

  
v3 a3;
  if ( 
a2 )
  {
    if ( 
a3 )
    {
      if ( *(
_BYTE *)(a2 8) < )
      {
        
v15 0;
        
v4 a3;
        
v5 = &v15;
        
v3 = &v15;
        while ( *
v4 )
        {
          if ( (
unsigned __int8)(*v4 32) <= 0x5Eu )
            *
v5++ = *v4++;
          else
            ++
v4;
        }
        *
v5 0;
        if ( !
Q_strlen(&v15) )
          
Q_strcpy(&v15"empty");
      }
      
v6 Q_strcmp(*(_DWORD *)(a2 4), v3);
      if ( *(
_BYTE *)(a2 8) & )
      {
        if ( !*(
_DWORD *)cls )
        {
          
v7 = *(_DWORD *)a2;
          
v8 Info_Serverinfo();
          
Info_SetValueForKey(v8v7v3512);
          
v9 Info_Serverinfo();
          
SV_BroadcastCommand("fullserverinfo \"%s\"\n"v9);
        }
      }
      
v10 = *(_DWORD *)(a2 8);
      if ( 
v10 )
      {
        if ( 
v6 )
        {
          if ( !(
BYTE1(v10) & 1) )
          {
            
Log_Printf("Server cvar \"%s\" = \"%s\"\n", *(_DWORD *)a2);
            
SV_BroadcastPrintf("\"%s\" changed to \"%s\"\n", *(_DWORD *)a2);
          }
          if ( *(
_BYTE *)(a2 8) & 0x20 )
          {
            if ( 
Q_strlen(v3) <= || (v12 Q_stricmp(v3"none"), v11 = (char *)&off_A7F80, !v12) )
              
v11 = (char *)&off_A7F80 2;
          }
          else
          {
            
v11 v3;
          }
          
Steam_SetCVar(*(_DWORD *)a2v11);
        }
      }
      
Z_Free(*(_DWORD *)(a2 4));
      
v13 Q_strlen(v3);
      
v14 Z_Malloc(v13 1);
      *(
_DWORD *)(a2 4) = v14;
      
Q_strcpy(v14v3);
      
Q_atof(*(_DWORD *)(a2 4));
      *(
float *)(a2 12) = a1;
    }
  }

__________________

Divide et vinces
approved plugins | steam account

I don't accept PM for support. Just ask on forums.
If you're looking for private work, PM me.

Last edited by joropito; 06-24-2010 at 16:08.
joropito is offline
Send a message via MSN to joropito
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 06-24-2010 , 18:19   Re: Function call
Reply With Quote #9

joropito thats interesting, that should work well for standart cvars, what about registered cvars by plugins ?
__________________
xPaw is offline
joropito
AlliedModders Donor
Join Date: Mar 2009
Location: pfnAddToFullPack
Old 06-24-2010 , 18:29   Re: Function call
Reply With Quote #10

Quote:
Originally Posted by xPaw View Post
joropito thats interesting, that should work well for standart cvars, what about registered cvars by plugins ?
If I'm not wrong:

set_pcvar_* is using pfnCvar_DirectSet so should be the same I guess.

set_cvar_* calls pfnCVarSet* which calls Cvar_DirectSet.


If someone can test it using orpheu would be nice.
__________________

Divide et vinces
approved plugins | steam account

I don't accept PM for support. Just ask on forums.
If you're looking for private work, PM me.

Last edited by joropito; 06-24-2010 at 18:31.
joropito is offline
Send a message via MSN to joropito
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 14:48.


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