Raised This Month: $ Target: $400
 0% 

can anyone add .ini file to this plugin! message shower


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
arvEL.
Senior Member
Join Date: Dec 2014
Location: Iraq
Old 02-10-2018 , 04:13   can anyone add .ini file to this plugin! message shower
Reply With Quote #1

hi guys.. this pluhin imessage

PHP Code:
#include <amxmodx>
#include <amxmisc>

new Array:g_Values
new Array:g_Messages
new g_MessagesNum
new g_Current

#define charsof(%1) (sizeof(%1)-1)

new amx_freq_imessage;

public 
plugin_init()
{
    
g_Messages=ArrayCreate(384);
    
g_Values=ArrayCreate(3);
    
register_plugin("Info. Messages"AMXX_VERSION_STR"AMXX Dev Team")
    
register_dictionary("imessage.txt")
    
register_dictionary("common.txt")
    
register_srvcmd("amx_imessage""setMessage")
    
amx_freq_imessage=register_cvar("amx_freq_imessage""10")
    
    new 
lastinfo[8]
    
get_localinfo("lastinfomsg"lastinfo7)
    
g_Current str_to_num(lastinfo)
    
set_localinfo("lastinfomsg""")
}

public 
infoMessage()
{
    if (
g_Current >= g_MessagesNum)
        
g_Current 0
        
    
// No messages, just get out of here
    
if (g_MessagesNum==0)
    {
        return;
    }
    
    new 
values[3];
    new 
Message[384];
    
    
ArrayGetString(g_Messagesg_CurrentMessagecharsof(Message));
    
ArrayGetArray(g_Valuesg_Currentvalues);
    
    new 
hostname[64];
    
    
get_cvar_string("hostname"hostname63);
    
replace(Message380"%hostname%"hostname);
    
    
set_hudmessage(values[0], values[1], values[2], -1.00.2020.2012.00.100.01, -1);                                                 
    
show_hudmessage(0"%s"Message);
    
    
client_print(0print_console"%s"Message);
    ++
g_Current;
    
    new 
Float:freq_im get_pcvar_float(amx_freq_imessage);    
    if (
freq_im 0.0)
        
set_task(freq_im"infoMessage"12345);
}

public 
setMessage()
{

    new 
Message[384];
    
    
remove_task(12345)
    
read_argv(1Message380)
    
    while (
replace(Message380"\n""^n")) {}
    
    new 
mycol[12]
    new 
vals[3];
    
    
read_argv(2mycol11)        // RRRGGGBBB
    
vals[2] = str_to_num(mycol[6])
    
    
mycol[6] = 0
    vals
[1] = str_to_num(mycol[3])
    
    
mycol[3] = 0
    vals
[0] = str_to_num(mycol[0])
    
    
g_MessagesNum++
    
    new 
Float:freq_im get_pcvar_float(amx_freq_imessage)
    
    
ArrayPushString(g_MessagesMessage);
    
ArrayPushArray(g_Valuesvals);
    
    if (
freq_im 0.0)
        
set_task(freq_im"infoMessage"12345)
    
    return 
PLUGIN_HANDLED
}

public 
plugin_end()
{
    new 
lastinfo[8]

    
num_to_str(g_Currentlastinfo7)
    
set_localinfo("lastinfomsg"lastinfo)

to use this plugin you should add your messages lines inside amxx.cfg like:

PHP Code:
amx_imessage "Welcome to %hostname%" "000255100"
amx_imessage "This server is using AMX Mod X\nVisit http://www.amxmodx.org" "000100255" 
can anyone edit this plugin and add .ini file,,, when i need add the message
just open messages.ini and add message no need to add message in amxx.cfg
__________________
arvEL. is offline
Send a message via Skype™ to arvEL.
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 13:39.


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