AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Function call (https://forums.alliedmods.net/showthread.php?t=130478)

ot_207 06-24-2010 08:05

Function call
 
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?

xPaw 06-24-2010 08:06

Re: Function call
 
There is none

ot_207 06-24-2010 08:20

Re: Function call
 
Quote:

Originally Posted by xPaw (Post 1218096)
There is none

But there must be something that the server does to inform players about cvar change. A message maybe?

GXLZPGX 06-24-2010 11:51

Re: Function call
 
Quote:

Originally Posted by ot_207 (Post 1218106)
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.

grimvh2 06-24-2010 12:15

Re: Function call
 
Quote:

Originally Posted by GXLZPGX (Post 1218332)
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.

ot_207 06-24-2010 12:26

Re: Function call
 
I am interested in functions that can be hooked with orpheu not messages that print that the x cvar has changed.

GXLZPGX 06-24-2010 12:49

Re: Function call
 
Quote:

Originally Posted by grimvh2 (Post 1218371)
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 (Post 1218381)
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.

YamiKaitou 06-24-2010 12:53

Re: Function call
 
Quote:

Originally Posted by GXLZPGX (Post 1218410)
You obviously haven't had administrative rights on any server before. Please try not to talk unless you know what you're talking about.

I could say the same to you

Quote:

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.
That is because amx_cvar and the menu are displaying the message, not the server. ot_207 is wanting to hook the message generated when you change a cvar with the FCVAR_SERVER flag. If you do not know what this flag does, then take a cvar that has this flag and change the value using RCON, you will see that all clients get notified of the new value.

grimvh2 06-24-2010 12:59

Re: Function call
 
Quote:

Originally Posted by GXLZPGX (Post 1218410)
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.




And I haven't yet come to far with Orpheu. Orpheu is very powerful, I'm sure their is a way.

I guess your the kind of people that whines about admin, when im the kind of person who ignores ur whining.

joropito 06-24-2010 16:04

Re: Function call
 
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;
    }
  }




All times are GMT -4. The time now is 14:48.

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