Admin Chat (Colorat)

In jos

descarca Admin Chat (Colorat)

Mesaj Scris de CelRau la data de Sam Noi 26, 2016 10:58 am

Descriere: Acesta este pluginul Admin Chat din AMXMODX rescris de la 0. Aveti in el tot cea ce este necesar.
Descarcare:
Spoiler:
#include <amxmodx>
#include <amxmisc>

/*===============================================
Base Builder by (C) DARKLAND Dev Team

Colored Chat v1.0
================================================*/

new g_bSync;
new g_bMax;

const Float:HUD_ADMIN_NORMAL_X = 0.05;
const Float:HUD_ADMIN_NORMAL_Y = 0.45;

const Float:HUD_ADMIN_CENTER_X = -1.0;
const Float:HUD_ADMIN_CENTER_Y = 0.28;

/*__________________________________
Plugin Init
___________________________________*/
public plugin_init()
{
register_plugin("Colored Chat", "1.0", "DARKLAND Dev Team");

register_clcmd("say", "g_bSay");
register_clcmd("say_team", "g_bSayTeam");

g_bSync = CreateHudSyncObj();
g_bMax = get_maxplayers();
}

/*_________________________________
Admins Chat
__________________________________*/
public g_bSayTeam(id)
{
new g_bArgs[256];
read_args(g_bArgs, charsmax(g_bArgs));
remove_quotes(g_bArgs);

if(g_bArgs[0] == '@')
{
if(is_user_admin(id))
{
new g_bPlayers[32], g_bNum;
get_players(g_bPlayers, g_bNum);

for(new i = 0; i < sizeof g_bPlayers; i++)
{
new g_bIndex = g_bPlayers[i];

if(!is_user_admin(g_bIndex))
continue;

new g_bName[32];
get_user_name(id, g_bName, charsmax(g_bName));
zp_colored_print(g_bIndex, "^x04(ADMINS CHAT)^x01 %s :^x04 %s", g_bName, g_bArgs);
}
}
}

return PLUGIN_CONTINUE;
}

/*__________________________________
Colored Chat
___________________________________*/
public g_bSay(id)
{
new g_bArgs[256];
read_args(g_bArgs, charsmax(g_bArgs));
remove_quotes(g_bArgs);

new rgb[3];

rgb[0] = random(255);
rgb[1] = random(255);
rgb[2] = random(255);

if(g_bArgs[0] == '@')
{
if(is_user_admin(id))
{
new Name[32];
get_user_name(id, Name, charsmax(Name));

set_hudmessage(rgb[0], rgb[1], rgb[2], HUD_ADMIN_NORMAL_X, HUD_ADMIN_NORMAL_Y, 0, 0.0, 5.0, 1.0, 3.0, -1)
ShowSyncHudMsg(0, g_bSync, "%s: %s", Name, g_bArgs);
}
else
{
new g_bName[32];
get_user_name(id, g_bName, charsmax(g_bName));
zp_colored_print(0, "^x04(ADMINS REPORT)^x01 %s : %s", g_bName, g_bArgs);

}
}

else if(g_bArgs[0] == '@' && g_bArgs[1] == '@')
{
if(is_user_admin(id))
{
new Name[32];
get_user_name(id, Name, charsmax(Name));

set_hudmessage(rgb[0], rgb[1], rgb[2], HUD_ADMIN_CENTER_X, HUD_ADMIN_CENTER_Y, 0, 0.0, 5.0, 1.0, 3.0, -1)
ShowSyncHudMsg(0, g_bSync, "%s: %s", Name, g_bArgs);
}
}

new g_bName[32];
get_user_name(id, g_bName, charsmax(g_bName));
zp_colored_print(0, "^x01%s :^x04 %s", g_bName, g_bArgs);

return PLUGIN_CONTINUE;
}


/*_______________________________________________
ZP Colored Print (zombieplague.inc)
_________________________________________________*/
zp_colored_print(target, const message[], any:...)
{
static buffer[512], i, argscount
argscount = numargs()

static g_msgSayText;

if(!g_msgSayText)
g_msgSayText = get_user_msgid("SayText");

if (!target)
{
static player
for (player = 1; player <= g_bMax; player++)
{
if (!is_user_connected(player))
continue;

static changed[5], changedcount
changedcount = 0

for (i = 2; i < argscount; i++)
{
if (getarg(i) == LANG_PLAYER)
{
setarg(i, 0, player)
changed[changedcount] = i
changedcount++
}
}

vformat(buffer, charsmax(buffer), message, 3)

message_begin(MSG_ONE_UNRELIABLE, g_msgSayText, _, player)
write_byte(player)
write_string(buffer)
message_end()

for (i = 0; i < changedcount; i++)
setarg(changed[i], 0, LANG_PLAYER)
}
}
else
{
vformat(buffer, charsmax(buffer), message, 3)

message_begin(MSG_ONE, g_msgSayText, _, target)
write_byte(target)
write_string(buffer)
message_end()
}
}

Nume:[Remaked] Admin Chat
Versiune: 1.0
Link oficial: here

Instalare:
1. Fisierul nume_plugin.sma il puneti in addons/amxmodx/scripting
2. Fisierul nume_plugin.amxx il puneti in addons/amxmodx/plugins
3. Intrati in fisierul addons/amxmodx/configs/plugins.ini si adaugati la urma:
Cod:
nume_plugin.amxx

Cvar-uri (se adauga in fisierul amxmodx\configs\amxx.cfg):
NU EXISTA!

Comenzi administrative (se tasteaza in consola si trebuie sa fiti administrator):
say @ mesaj - > afiseaza un mesaj hud pozitionat in stanga centru. (Doar Admini)
say @ mesaj -> raporteaza un jucator (Admin + Jucator Simplu)
say @@ mesaj -> afiseaza un mesaj hud pozitionat pe centru (Doar Admini)
say_team @ mesaj -> chat-ul adminilor

Comenzi publice (se tasteaza in joc prin apasarea tastei Y):
-

Module necesare (se sterge ; din fata modulului de mai jos; acestea nu necesita module
avatar
CelRau
Registered user
Registered user

Mesaje : 184
Data de inscriere : 26/11/2016

Sus In jos

Sus


 
Permisiunile acestui forum:
Nu puteti raspunde la subiectele acestui forum