Raised This Month: $51 Target: $400
 12% 

[Request] Advert Messages


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Snake.
Senior Member
Join Date: Jul 2017
Old 05-02-2019 , 18:54   [Request] Advert Messages
Reply With Quote #1

I need a advert messages shower in every x seconds.I know there are lots of plugins doing this but they allow to put message only in .ini files. I want to put messages in sma for multi lang.
Snake. is offline
Send a message via Skype™ to Snake.
HITLER
Member
Join Date: Jul 2018
Location: www
Old 05-08-2019 , 21:07   Re: [Request] Advert Messages
Reply With Quote #2

you want advert in chat only or using hud ? give me more information about how would you like the plugin to be
__________________
HITLER is offline
Send a message via Skype™ to HITLER
Snake.
Senior Member
Join Date: Jul 2017
Old 05-09-2019 , 03:51   Re: [Request] Advert Messages
Reply With Quote #3

Only in chat, i want them as multi lang.
Snake. is offline
Send a message via Skype™ to Snake.
raizo11
BANNED
Join Date: Dec 2013
Location: https://t.me/pump_upp
Old 05-09-2019 , 04:39   Re: [Request] Advert Messages
Reply With Quote #4

Code:
#include <amxmodx>
#include <colorchat>
 
#define PLUGIN "Lang Message"
#define VERSION "1.0"
#define AUTOR   "raizo"


new AdvTimeOne, AdvTimeTwo;

new const LANG_FILE[][] =
{
    "[en]",
    "ADVERTISMENT_ONE = ^1Put ^3message^1 here ^4please^1!",
    "ADVERTISMENT_TWO = ^1Put ^3here^1 message ^4please^1!",

    " ",
    "[ro]",

    "ADVERTISMENT_ONE = ^1Pune ^3mesajul^1 aici ^4te rog^1!",
    "ADVERTISMENT_TWO = ^1Pune ^3aici^1 mesajul ^4te rog^1!"
}

public plugin_init()
{
    register_plugin(PLUGIN, VERSION, AUTOR);

    AdvTimeOne = register_cvar("amx_messageone","60.0");
    AdvTimeTwo = register_cvar("amx_messagetwo","120.0");
   
    set_task(get_pcvar_float(AdvTimeOne), "AdvertismentOne");
    set_task(get_pcvar_float(AdvTimeTwo), "AdvertismentTwo");
 
    register_dictionary("lang_messages.txt")
}

public plugin_precache()
{  
    if(!file_exists("addons/amxmodx/data/lang/lang_messages.txt"))
    {
        for(new i=0;i< sizeof LANG_FILE;i++)
        {
            write_file("addons/amxmodx/data/lang/lang_messages.txt", LANG_FILE[i]);
        }
    }
   
}


public AdvertismentOne() ColorChat(0, GREEN, "^3[^4Lang Messages^3]^1 %L", LANG_PLAYER, "ADVERTISMENT_ONE"), set_task(get_pcvar_float(AdvTimeOne), "AdvertismentOne");

public AdvertismentTwo() ColorChat(0, GREEN, "^3[^4Lang Messages^3]^1 %L", LANG_PLAYER, "ADVERTISMENT_TWO"), set_task(get_pcvar_float(AdvTimeTwo), "AdvertismentTwo");

Code:
#include <amxmodx>
#include <colorchat>
 
#define PLUGIN "Lang Message"
#define VERSION "1.0"
#define AUTOR   "raizo"


new AdvTime

new const LANG_FILE[][] =
{
    "[en]",
    "ADVERTISMENT_ONE = ^1Put ^3message^1 here ^4please ONE ^1!",
    "ADVERTISMENT_TWO = ^1Put ^3here^1 message ^4please TWO ^1!",
    "ADVERTISMENT_THREE = ^1Put ^3message^1 here ^4please THREE^1!",
    "ADVERTISMENT_FOUR = ^1Put ^3here^1 message ^4please FOUR^1!",
    "ADVERTISMENT_FIVE = ^1Put ^3message^1 here ^4please FIVE^1!",
    "ADVERTISMENT_SIX = ^1Put ^3here^1 message ^4please SIX^1!",
    "ADVERTISMENT_SEVEN = ^1Put ^3message^1 here ^4please SEVEN^1!",
    "ADVERTISMENT_EIGHT = ^1Put ^3here^1 message ^4please EIGHT^1!",
    "ADVERTISMENT_NINE = ^1Put ^3message^1 here ^4please NINE^1!",
    "ADVERTISMENT_TEN = ^1Put ^3here^1 message ^4please TEN^1!"
}

new const LANG_FILE_PREFIXES[][] =
{
    "ADVERTISMENT_ONE",
    "ADVERTISMENT_TWO",
    "ADVERTISMENT_THREE",
    "ADVERTISMENT_FOUR",
    "ADVERTISMENT_FIVE",
    "ADVERTISMENT_SIX",
    "ADVERTISMENT_SEVEN",
    "ADVERTISMENT_EIGHT",
    "ADVERTISMENT_NINE",
    "ADVERTISMENT_TEN"

}

public plugin_init()
{
    register_plugin(PLUGIN, VERSION, AUTOR);

    AdvTime = register_cvar("amx_messageone","60.0");
   
    set_task(get_pcvar_float(AdvTime), "Advertisment");
 
    register_dictionary("lang_messages.txt")
}

public plugin_precache()
{  
    if(!file_exists("addons/amxmodx/data/lang/lang_messages.txt"))
    {
        for(new i=0;i< sizeof LANG_FILE;i++)
        {
            write_file("addons/amxmodx/data/lang/lang_messages.txt", LANG_FILE[i]);
        }
    }
   
}

public Advertisment()ColorChat(0, GREEN, "^3[^4Lang Messages^3]^1 %L", LANG_PLAYER, LANG_FILE_PREFIXES[random(sizeof(LANG_FILE_PREFIXES))] ), set_task(get_pcvar_float(AdvTime), "Advertisment");
raizo11 is offline
Send a message via ICQ to raizo11 Send a message via AIM to raizo11 Send a message via MSN to raizo11 Send a message via Yahoo to raizo11 Send a message via Skype™ to raizo11
Snake.
Senior Member
Join Date: Jul 2017
Old 05-09-2019 , 06:55   Re: [Request] Advert Messages
Reply With Quote #5

Thank you!
Snake. is offline
Send a message via Skype™ to Snake.
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 04:04.


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