AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   Advertisements 2.1 (Updated 2021/02/06) (https://forums.alliedmods.net/showthread.php?t=155705)

Ryan2 07-06-2023 13:07

Re: Advertisements 2.1 (Updated 2021/02/06)
 
Quote:

Originally Posted by mayersdz (Post 2806865)
why are you advertising your shit on my server ? talkiing abotu that 5 usd ad .

OP does not have control over what is posted in your server, you do.

Check your advertisements.txt

Britney 07-16-2023 09:38

Re: Advertisements 2.1 (Updated 2021/02/06)
 
Hello, i have installed this plugin and only message center work. But i just need a chat message.
do you think to look at my configuration to know if I have a problem in it?
In the chat line I put a big Bonjouuuuuur to perform my tests but nothing appears on my server. Only message center work. I have www.domain.com appear

// Advertisements 2.1
// by Tsunami
//
// Types
// -----
// center: Center message
// chat: Chat message
// hint: Hint message
// menu: Menu message
// top: Top message
//
// Flags (optional)
// -----
// Accepts flags of admins that will not see the advertisement.
// When omitted everyone will see the advertisement.
// When left empty only admins will see the advertisement.

"Advertisements"
{
"1"
{
"center" "www.domain.com"
}
"2"
{
"center" "[email protected]"
"hint" "[email protected]"
}
"3"
{
"menu" "Next map is {nextmap} in {timeleft} minutes."
"flags" "cft"
}
"4"
{
"chat" "Bonjouuuuuuuuuuuuuur"
"flags" "z"
}
"5"
{
"top" "{orange}Admins: friendly fire is {mp_friendlyfire}."
"flags" ""
}
}

My servercfg

sm_advertisements_enabled 1
sm_advertisements_file "advertisements.txt"
sm_advertisements_interval 10
sm_advertisements_reload

thx a lot.

paulo_crash 07-16-2023 10:28

Re: Advertisements 2.1 (Updated 2021/02/06)
 
Quote:

Originally Posted by Britney (Post 2807259)
Hello, i have installed this plugin and only message center work. But i just need a chat message.
do you think to look at my configuration to know if I have a problem in it?
In the chat line I put a big Bonjouuuuuur to perform my tests but nothing appears on my server. Only message center work. I have www.domain.com appear

Test this configuration:
Code:

// Advertisements 2.1
// by Tsunami
//
// Types
// -----
// center: Center message
// chat: Chat message
// hint: Hint message
// menu: Menu message
// top: Top message
//
// Flags (optional)
// -----
// Accepts flags of admins that will not see the advertisement.
// When omitted everyone will see the advertisement.
// When left empty only admins will see the advertisement.

"Advertisements"
{
        "1"
        {
                "center" "www.domain.com"
        }
        "2"
        {
                "center" " [email protected] "
        }
        "3"
        {
                "menu" "Next map is {nextmap} in {timeleft} minutes."
                "flags" "cft"
        }
        "4"
        {
                "chat" "Bonjouuuuuuuuuuuuuur"
                "flags" "z"
        }
        "5"
        {
                "top" "{orange}Admins: friendly fire is {mp_friendlyfire}."
                "flags" ""
        }
        "6"
        {
                "hint" " [email protected] "
        }
}


Markie84 07-18-2023 05:11

Re: Advertisements 2.1 (Updated 2021/02/06)
 
Is there a way to handle two different chat annoucments with two different intervals?

Paralhama 02-19-2024 20:58

Re: Advertisements 2.1 (Updated 2021/02/06)
 
Your plugin is incredible!
I'm using it on my Fistful of Frags servers
but when using "Super kick is {sm_super_kick}.""
the result is "Super Kick is 0" or "Super Kick is 0"

So I made this small change

Instead of displaying 1 it will display "ON"
Instead of displaying 0 it will display "OFF"
If the variable is not found it will go to the next advertisement

PHP Code:

void ProcessVariables(const char[] messagechar[] bufferint maxlength)
{
    
char name[64], value[256];
    
int buf_idxiname_len;
    
ConVar hConVar;

    while (
message[i] && buf_idx maxlength 1) {
        if (
message[i] != '{' || (name_len FindCharInString(message[1], '}')) == -1) {
            
buffer[buf_idx++] = message[i++];
            continue;
        }

        
strcopy(namename_len 1message[1]);

        
// Block responsible for replacing variables
        
if ((hConVar FindConVar(name))) {
            
hConVar.GetString(valuesizeof(value));
            
// I modified this part to specifically handle the cases of 0 and 1
            
if (StrEqual(value"1")) {
                
buf_idx += strcopy(buffer[buf_idx], maxlength buf_idx"ON");
            } else if (
StrEqual(value"0")) {
                
buf_idx += strcopy(buffer[buf_idx], maxlength buf_idx"OFF");
            } else {
                
buf_idx += strcopy(buffer[buf_idx], maxlength buf_idxvalue);
            }
        } else {
            
// If the variable is not found, clear the buffer and exit the loop
            
buf_idx 0;
            break;
        }

        
+= name_len 2;
    }

    
buffer[buf_idx] = '\0';




All times are GMT -4. The time now is 12:21.

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