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

Vip online fix message


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
LauNcHerR
Junior Member
Join Date: Jan 2010
Old 08-06-2016 , 15:41   Vip online fix message
Reply With Quote #1

When vip is connected and change nickname to other nick with no access, plugin show other nick in message.. but real this nick no have access and not should to shows in message..
When normal player connect on server and change nick with access, pugin not show this nick on online vips.
Need to fix this bugs.
Code:
#include <amxmodx> #include <engine> 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("Online vips","1.3","expp121")         register_think(g_ClassName,"ForwardThink")         g_admin_enable = register_cvar("sa_plugin_on","1")     g_online_color = register_cvar("sa_online_color","255 215 0")     g_offline_color = register_cvar("sa_offline_color","67 110 238")     g_msg_xypos = register_cvar("sa_msg_xypos","0.01 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_LEVEL_H)     {         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, "Vip 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) }

Last edited by LauNcHerR; 08-06-2016 at 18:14.
LauNcHerR is offline
speedykiller2012
Senior Member
Join Date: Jun 2014
Old 08-06-2016 , 19:41   Re: Vip online fix message
Reply With Quote #2

Better use this one !.
https://forums.alliedmods.net/showthread.php?t=211627
speedykiller2012 is offline
LauNcHerR
Junior Member
Join Date: Jan 2010
Old 08-07-2016 , 05:39   Re: Vip online fix message
Reply With Quote #3

This code is 1:2 with my code...
Where is #include <VIPSystem> ??
LauNcHerR is offline
addons_zz
Veteran Member
Join Date: Aug 2015
Location: Dreams, zz
Old 08-07-2016 , 08:58   Re: Vip online fix message
Reply With Quote #4

Quote:
Originally Posted by speedykiller2012 View Post
Quote:
Originally Posted by LauNcHerR View Post
This code is 1:2 with my code...
Where is #include <VIPSystem> ??
I think you should not use that plugin. Because it is not just an unapproved plugin, it is a trashed one.
You can search for an new plugin on the Approved Section, and may be on at New Plugins Submissions.
__________________
Plugin: Sublime Text - ITE , Galileo
Multi-Mod: Manager / Plugin / Server

Support me on Patreon, Ko-fi, Liberapay or Open Collective
addons_zz is offline
LauNcHerR
Junior Member
Join Date: Jan 2010
Old 08-08-2016 , 05:45   Re: Vip online fix message
Reply With Quote #5

Fix my code?
LauNcHerR is offline
addons_zz
Veteran Member
Join Date: Aug 2015
Location: Dreams, zz
Old 08-08-2016 , 13:17   Re: Vip online fix message
Reply With Quote #6

Quote:
Originally Posted by LauNcHerR View Post
Fix my code?
From where your code comes from?
__________________
Plugin: Sublime Text - ITE , Galileo
Multi-Mod: Manager / Plugin / Server

Support me on Patreon, Ko-fi, Liberapay or Open Collective

Last edited by addons_zz; 08-08-2016 at 13:17. Reason: misspelling
addons_zz is offline
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 05:28.


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