PDA

View Full Version : Show Super Admins Online


alicx
03-29-2013, 17:59
.:: Description ::.
This plugin Show super admins online :D
I maded This plugin for this Plugin: https://forums.alliedmods.net/showthread.php?t=178971

For helping me Thanks to: https://forums.alliedmods.net/member.php?u=177261



.:: Modules ::.
amxmodx
engine


.:: Features: ::.
-Show Super Admins Online
-Can change the place and the color of words


.:: Cvars ::.

ssa_plugin_on "1" -> Turn Admin Show On/Off
ssa_online_color "0 130 0" -> When Admin Online Is Default Color Green
sas_offline_color "255 0 0" -> When No Admin On Server Default Color Red
ssa_msg_xypos "0.02 0.2" -> Hud Msg Position Currently On Left Side

If You Want To Have The Hud Msg On Right Side Set Cvar sa_msg_xypos "0.8 0.2"


.:: Screen ::.
http://img11.hostingpics.net/pics/402890Example.png (http://www.hostingpics.net/viewer.php?id=402890Example.png)

Enjoy :D
This is my First Post so if there is a bug please correct it and i will update it :D

YamiKaitou
03-29-2013, 18:09
Where is the plugin?

sulinek
03-29-2013, 21:30
:DDDD

alicx
03-30-2013, 01:51
Sorry i have missed it !! now i updated it :D

sami_spt
03-30-2013, 03:43
listen:

http://forums.alliedmods.net/showthread.php?p=830495

U took the plugin from here and only changed the names to Super Admin and changed the cvars and changed the position of the hud.


VOTE FOR TRASH/UNAPPROVED.

(EDIT):: OW OW OW OW , 1 more thing: http://forums.alliedmods.net/showthread.php?t=212058 => U requested it as in u didnt make it.


UR PLUGIN:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <engine>

#define PLUGIN "Show Super Admins Online"
#define VERSION "1.1"
#define AUTHOR "alicx"

new bool:g_bAdminNick
new bool:is_admin_connected[33]
new g_msg[512]

new g_admin_enable
new g_online_color
new g_offline_color
new g_msg_xypos

new g_SyncAdmin
new g_iAdminCount
new g_iMaxPlayers

new g_ClassName[] = "admin_msg"

public plugin_init()
{
register_plugin( PLUGIN, VERSION, AUTHOR )

register_think(g_ClassName,"ForwardThink")

g_admin_enable = register_cvar("ssa_plugin_on","1")
g_online_color = register_cvar("ssa_online_color","0 130 0")
g_offline_color = register_cvar("ssa_offline_color","255 0 0")
g_msg_xypos = register_cvar("ssa_msg_xypos","0.16 0.0")

g_SyncAdmin = CreateHudSyncObj()
g_iMaxPlayers = get_maxplayers()

new iEnt = create_entity("info_target")
entity_set_string(iEnt, EV_SZ_classname, g_ClassName)
entity_set_float(iEnt, EV_FL_nextthink, get_gametime() + 2.0)
}

public client_putinserver(id)
{
if(get_user_flags(id) & ADMIN_RCON)
{
is_admin_connected[id] = true
g_iAdminCount++
set_admin_msg()
}
if(g_iAdminCount == 0)
set_admin_msg()
}

public client_disconnect(id)
{
if(is_admin_connected[id])
{
is_admin_connected[id] = false
g_iAdminCount--
set_admin_msg()
}
}

public client_infochanged(id)
{
if(is_admin_connected[id])
{
static NewName[32], OldName[32]
get_user_info(id, "name", NewName, 31)
get_user_name(id, OldName, 31)

if(!equal(OldName, NewName))
{
g_bAdminNick = true
}
}
}

public set_admin_msg()
{
static g_iAdminName[32], pos, i
pos = 0
pos += formatex(g_msg[pos], 511-pos, "Super Admins Online: %d", g_iAdminCount)

for(i = 1 ; i <= g_iMaxPlayers ; i++)
{
if(is_admin_connected[i])
{
get_user_name(i, g_iAdminName, 31)
pos += formatex(g_msg[pos], 511-pos, "^n%s", g_iAdminName)
}
}
}

public admins_online()
{
if(get_pcvar_num(g_admin_enable))
{
static r, g, b, Float:x,Float:y
HudMsgPos(x,y)

if (g_iAdminCount > 0)
{
HudMsgColor(g_online_color, r, g, b)
set_hudmessage(r, g, b, x, y, _, _, 4.0, _, _, 4)
ShowSyncHudMsg(0, g_SyncAdmin, "%s", g_msg)
}
else
{
HudMsgColor(g_offline_color, r, g, b)
set_hudmessage(r, g, b, x, y, _, _, 4.0, _, _, 4)
ShowSyncHudMsg(0, g_SyncAdmin, "%s", g_msg)
}
}
return PLUGIN_HANDLED
}

public ForwardThink(iEnt)
{
admins_online()

if(g_bAdminNick)
{
set_admin_msg()
g_bAdminNick = false
}
entity_set_float(iEnt, EV_FL_nextthink, get_gametime() + 2.0)
}

public HudMsgColor(cvar, &r, &g, &b)
{
static color[16], piece[5]
get_pcvar_string(cvar, color, 15)

strbreak( color, piece, 4, color, 15)
r = str_to_num(piece)

strbreak( color, piece, 4, color, 15)
g = str_to_num(piece)
b = str_to_num(color)
}

public HudMsgPos(&Float:x, &Float:y)
{
static coords[16], piece[10]
get_pcvar_string(g_msg_xypos, coords, 15)

strbreak(coords, piece, 9, coords, 15)
x = str_to_float(piece)
y = str_to_float(coords)
}


ORIGINAL PLUGIN:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <engine>

#define PLUGIN "Show Admins Online"
#define VERSION "1.1"
#define AUTHOR "vato loco [GE-S] & Alka"

new bool:g_bAdminNick
new bool:is_admin_connected[33]
new g_msg[512]

new g_admin_enable
new g_online_color
new g_offline_color
new g_msg_xypos

new g_SyncAdmin
new g_iAdminCount
new g_iMaxPlayers

new g_ClassName[] = "admin_msg"

public plugin_init()
{
register_plugin( PLUGIN, VERSION, AUTHOR )

register_think(g_ClassName,"ForwardThink")

g_admin_enable = register_cvar("sa_plugin_on","1")
g_online_color = register_cvar("sa_online_color","0 130 0")
g_offline_color = register_cvar("sa_offline_color","255 0 0")
g_msg_xypos = register_cvar("sa_msg_xypos","0.02 0.2")

g_SyncAdmin = CreateHudSyncObj()
g_iMaxPlayers = get_maxplayers()

new iEnt = create_entity("info_target")
entity_set_string(iEnt, EV_SZ_classname, g_ClassName)
entity_set_float(iEnt, EV_FL_nextthink, get_gametime() + 2.0)
}

public client_putinserver(id)
{
if(get_user_flags(id) & ADMIN_KICK)
{
is_admin_connected[id] = true
g_iAdminCount++
set_admin_msg()
}
if(g_iAdminCount == 0)
set_admin_msg()
}

public client_disconnect(id)
{
if(is_admin_connected[id])
{
is_admin_connected[id] = false
g_iAdminCount--
set_admin_msg()
}
}

public client_infochanged(id)
{
if(is_admin_connected[id])
{
static NewName[32], OldName[32]
get_user_info(id, "name", NewName, 31)
get_user_name(id, OldName, 31)

if(!equal(OldName, NewName))
{
g_bAdminNick = true
}
}
}

public set_admin_msg()
{
static g_iAdminName[32], pos, i
pos = 0
pos += formatex(g_msg[pos], 511-pos, "Admins Online: %d", g_iAdminCount)

for(i = 1 ; i <= g_iMaxPlayers ; i++)
{
if(is_admin_connected[i])
{
get_user_name(i, g_iAdminName, 31)
pos += formatex(g_msg[pos], 511-pos, "^n%s", g_iAdminName)
}
}
}

public admins_online()
{
if(get_pcvar_num(g_admin_enable))
{
static r, g, b, Float:x,Float:y
HudMsgPos(x,y)

if (g_iAdminCount > 0)
{
HudMsgColor(g_online_color, r, g, b)
set_hudmessage(r, g, b, x, y, _, _, 4.0, _, _, 4)
ShowSyncHudMsg(0, g_SyncAdmin, "%s", g_msg)
}
else
{
HudMsgColor(g_offline_color, r, g, b)
set_hudmessage(r, g, b, x, y, _, _, 4.0, _, _, 4)
ShowSyncHudMsg(0, g_SyncAdmin, "%s", g_msg)
}
}
return PLUGIN_HANDLED
}

public ForwardThink(iEnt)
{
admins_online()

if(g_bAdminNick)
{
set_admin_msg()
g_bAdminNick = false
}
entity_set_float(iEnt, EV_FL_nextthink, get_gametime() + 2.0)
}

public HudMsgColor(cvar, &r, &g, &b)
{
static color[16], piece[5]
get_pcvar_string(cvar, color, 15)

strbreak( color, piece, 4, color, 15)
r = str_to_num(piece)

strbreak( color, piece, 4, color, 15)
g = str_to_num(piece)
b = str_to_num(color)
}

public HudMsgPos(&Float:x, &Float:y)
{
static coords[16], piece[10]
get_pcvar_string(g_msg_xypos, coords, 15)

strbreak(coords, piece, 9, coords, 15)
x = str_to_float(piece)
y = str_to_float(coords)
}



Tell me one thing that is different~!

TheDS1337
03-30-2013, 12:12
OFC the author's name (lol)

baneado
03-30-2013, 15:38
sami_spt it's right, he didn't make anything

trash?

sami_spt
03-31-2013, 02:09
sami_spt it's right, he didn't make anything

trash?

Ya, trash.. because its not his 'plugin' and as you can see and all know, this aint the 1st time he steals some1's plugin and edit it and submit it.:bacon!::bacon!::bacon!::bacon!:

baneado
03-31-2013, 04:37
Ya, trash.. because its not his 'plugin' and as you can see and all know, this aint the 1st time he steals some1's plugin and edit it and submit it.:bacon!::bacon!::bacon!::bacon!:

I reported the thread

didoWEE
03-31-2013, 07:10
Same situation: http://forums.alliedmods.net/showthread.php?t=212075VOTE FOR TRASH/UNAPPROVED

YamiKaitou
03-31-2013, 07:22
I reported the thread
Thank you for doing the correct thing, unlike everyone else who made the claim


Trashed

Plugin was not created by you at all (you requested the plugin and then blanked your post after you got it, also a violation of the forum rules)
You did not provide appropriate credit to the original author(s)
Highly doubt you can support it if it has issues