király  THX  Már csak át kéne írni kékre
Kód: /* Admin glow About: This plugin allows admins to make other players glow in a spesfic color, the supported colors are: red,purple,green,yellow & blue. This plugin logs & echos admin actions, it does NOT allow admins to enter the RGB value of th color they want ( To stop usage of "cheat" colors that make ppl hard to spot). This plugin also support having players go say /glow <color> to make themself glow in any of the defined colors.
Usage: amx_glow <name or #userid> <color> amx_unglow <name or #userid>
say /glow <color>
Modules required: fun
FAQ) Q) How do i enable public glow? A) Check in the define section-
Q) Can i disable the public glow on the server in runtime? A) Yes, change the amx_publicglow cvar.
Plugin forum thread: http://www.amxmodx.org/forums/viewtopic.php?t=1531
Credits: OP`s in #amxmod @ Quakenet, for helping me alot with my endless questions.
Changelog: 1.3.3 ( 3.11.2004 ) - Fixed: Fixed possible issue with index out of bounds - Added: Making players glow engine module instead of fun module ( change WhatModule define, fun module is standard) 1.3.2 ( 06.07.2004 ) - Fixed: Fixed possible issue with steamids being to long (Would just be text cut on in logs/text)
1.3.1 ( 01.05.2004 ) - Fixed: Error preventing the plugin from compiling.
1.3.0 ( 30.04.2004 ) - Added: say /unglow ( Used by the public for making themself stopping to glow.
1.2.0 ( 27.04.2004 ) - Removed: Colors, lime,pink,gold as they looked the same as others ingame. - Changed: Color message sendt when public glow is used is now in the same color as what the person is glowing in.
1.1.0 ( 27.04.2004 ) - Added colors:purple,lime,aqua,pink,silver,gold ( Credits to vision for taking the time to find colors) - Added: Plugin now sends a list of colors to admins/players using incorrect colors. - Added: say /glow <color> for public usage. controled by ( amx_publicglow cvar) (Remember its not enabled by default. You need to change: #define PublicGlow)
1.0.0 ( 25.04.2004 ) - First release */
#include <amxmodx> #include <amxmisc>
#define WhatModule 2 // 1 = Enable glow via the engine module | 2 = Enable glwo via the fun module #define LogAdminActions 1 // 0 = No loggin | 1 = Log admin actions #define PublicGlow 1 // 0 = Public glow code inlcuded | 1 = Public glow code is included. #define MaxColorCount 7 // Dont change this one.
#if WhatModule == 1 #include <engine> #else #include <fun> #endif
new g_ColorNames[MaxColorCount][12] = { "red","green","blue","yellow","purple","aqua","silver" } new g_ColorR[MaxColorCount] = { 255,0,0,255,255,0,192 } new g_ColorG[MaxColorCount] = { 0,255,0,255,0,255,192 } new g_ColorB[MaxColorCount] = { 0,0,255,0,255,255,192 }
new g_Players[33] // This array contains the color a player is glowing in. ( if any ) -1 means no color
public plugin_init() { register_plugin("Admin glow","1.3.3","EKS") register_concmd("amx_glow","CMD_Glow",ADMIN_KICK,"<nick or #userid> <color>") register_concmd("amx_unglow","CMD_UnGlow",ADMIN_KICK,"<nick or #userid>")
#if PublicGlow == 1 register_clcmd("say /glow","public_glow",0,"say /glow <color>") register_clcmd("say /unglow","public_unglow",0,"say /unglow") register_cvar("amx_publicglow","1") #endif }
public CMD_Glow(id,level,cid) // This is the funtion called by amx_glow { new VictimName[32],VictimID read_argv(1,VictimName,31) // This code here reads out the targed. VictimID = cmd_target(7,VictimName,32) // This code here tryes to find out the player index. Either from a nick or #userid if ((get_user_flags(VictimID) & ADMIN_IMMUNITY) && VictimID != id || !cmd_access (id,level,cid,2) ) { return PLUGIN_HANDLED; } // This code is kind of "long", its job is to. Stop actions against admins with immunity, Stop actions action if the user lacks access, or is a bot/hltv new AdminName[32],Color[12] // There is no point in starting to make arrays thats not needed, if the above if is true. new ColorNR = -1 // This int is made with the value -1 so it can easly be used to check if a valid color has been found & later be used to log what color the admin used. read_argv(2,Color,11) for(new i = 0;i<MaxColorCount;i++) // This loop is used to check every entry in g_ColorNames { if (equal(Color,g_ColorNames[i],11)) { #if WhatModule == 2 set_user_rendering(VictimID,kRenderFxGlowShell,g_ColorR[i],g_ColorG[i],g_ColorB[i],kRenderNormal,25) #else set_rendering(VictimID,kRenderFxGlowShell,g_ColorR[i],g_ColorG[i],g_ColorB[i],kRenderNormal,25) #endif ColorNR = i g_Players[VictimID] = i } } if(ColorNR == -1) // If no vaild color has been found, tell the admin and stop the plugin. { new ColorList[128] for(new i = 0;i<MaxColorCount;i++) { add(ColorList,127,g_ColorNames[i]) add(ColorList,127," ") // This is a evil hack, to add spaces. } console_print(id,"[AMX] %s is not a supported color,vaild colors are:%s",Color,ColorList) return PLUGIN_HANDLED } get_user_name(id,AdminName,31) get_user_name(VictimID,VictimName,31) switch(get_cvar_num("amx_show_activity")) { case 2: client_print(0,print_chat,"ADMIN %s: has made %s glow %s",AdminName,VictimName,g_ColorNames[ColorNR]) case 1: client_print(0,print_chat,"ADMIN: %s is now glowing %s",VictimName,g_ColorNames[ColorNR]) } #if LogAdminActions == 1 new parm[4] /*0 = Victim id | 1 = Admin id | 2 = Used to control if its a gag or Ungag */ parm[0] = VictimID parm[1] = id parm[2] = 0 parm[3] = ColorNR LogAdminAction(parm) #endif return PLUGIN_HANDLED }
public CMD_UnGlow(id,level,cid) // Removed gaged player ( done via console command ) { new VictimName[32],AdminName[32],VictimID read_argv(1,VictimName,31) // This code here reads out the targed. VictimID = cmd_target(7,VictimName,32) // This code here tryes to find out the player index. Either from a nick or #userid if ((get_user_flags(VictimID) & ADMIN_IMMUNITY) && VictimID != id || !cmd_access (id,level,cid,2) || !VictimID ) { return PLUGIN_HANDLED; } // This code is kind of "long", its job is to. Stop actions against admins with immunity, Stop actions action if the user lacks access, or is a bot/hltv
get_user_name(id,AdminName,31) get_user_name(VictimID,VictimName,31) if(g_Players[VictimID] == -1) { console_print(id,"[AMX] %s is not glowing in any color",VictimName) return PLUGIN_HANDLED } #if WhatModule == 2 set_user_rendering(VictimID,kRenderFxGlowShell,0,0,0,kRenderNormal,25) #else set_rendering(VictimID,kRenderFxGlowShell,0,0,0,kRenderNormal,25) #endif switch(get_cvar_num("amx_show_activity")) { case 2: client_print(0,print_chat,"ADMIN %s: made %s stop glowing %s",AdminName,VictimName,g_ColorNames[g_Players[VictimID]]) case 1: client_print(0,print_chat,"ADMIN: %s is no longer glowing %s",VictimName,g_ColorNames[g_Players[VictimID]]) } g_Players[VictimID] = -1 #if LogAdminActions == 1 new parm[4] /*0 = Victim id | 1 = Admin id | 2 = Used to control if its a gag or Ungag */ parm[0] = VictimID parm[1] = id parm[2] = 1 LogAdminAction(parm) #endif return PLUGIN_HANDLED }
#if PublicGlow == 1 public public_glow(id) // This function handels say /glow { if(get_cvar_num("amx_publicglow") == 0) { client_print(id,3,"[AMX]Public glow is disabled. ") return PLUGIN_HANDLED } new Color[12] read_argv(2,Color,31) new ColorNR = -1 for(new i = 0;i<MaxColorCount;i++) // This loop is used to check every entry in g_ColorNames { if (equal(Color,g_ColorNames[i],11)) { #if WhatModule == 2 set_user_rendering(id,kRenderFxGlowShell,g_ColorR[i],g_ColorG[i],g_ColorB[i],kRenderNormal,25) #else set_rendering(id,kRenderFxGlowShell,g_ColorR[i],g_ColorG[i],g_ColorB[i],kRenderNormal,25) #endif ColorNR = i g_Players[id] = i } } if(ColorNR == -1) // If no vaild color has been found, tell the player and stop the plugin. { new ColorList[128] for(new i = 0;i<MaxColorCount;i++) { add(ColorList,127,g_ColorNames[i]) add(ColorList,127," ") // This is a evil hack, to add spaces. } client_print(id,3,"[AMX] %s is not a supported color,vaild colors are:%s",Color,ColorList) return PLUGIN_HANDLED } new PlayerName[32] get_user_name(id,PlayerName,31) set_hudmessage(g_ColorR[ColorNR], g_ColorG[ColorNR], g_ColorB[ColorNR], 0.05, 0.55, 0, 6.0, 6.0, 0.5, 0.15, 3) show_hudmessage(id, "%s has made himself glow in %s",PlayerName,Color) return PLUGIN_CONTINUE }
public public_unglow(id) // This function handels say /unglow { if(get_cvar_num("amx_publicglow") == 0) { client_print(id,3,"[AMX]Public glow is disabled.") return PLUGIN_HANDLED } if(g_Players[id] == -1) { client_print(id,3,"[AMX]Your not glowing in any color") return PLUGIN_HANDLED } new PlayerName[32] #if WhatModule == 2 set_user_rendering(id,kRenderFxGlowShell,0,0,0,kRenderNormal,25) #else set_rendering(id,kRenderFxGlowShell,0,0,0,kRenderNormal,25) #endif get_user_name(id,PlayerName,31) set_hudmessage(g_ColorR[g_Players[id]], g_ColorG[g_Players[id]], g_ColorB[g_Players[id]], 0.05, 0.55, 0, 6.0, 6.0, 0.5, 0.15, 3) show_hudmessage(id, "%s has stopped glowing %s",PlayerName,g_ColorNames[g_Players[id]]) g_Players[id] = -1 return PLUGIN_CONTINUE } #endif
#if LogAdminActions == 1 LogAdminAction(parm[]) // This code is what removes the gag. { new VictimName[32],AdminName[32],AdminAuth[35],VictimAuth[35] get_user_name(parm[1],AdminName,31) get_user_name(parm[0],VictimName,31) get_user_authid(parm[1],AdminAuth,34) get_user_authid(parm[0],VictimAuth,34)
if(parm[2] == 0) log_amx("Glow: ^"%s<%s>^" has made %s <%s> glow %s",AdminName,AdminAuth,VictimName,VictimAuth,g_ColorNames[parm[3]]) if(parm[2] == 1) log_amx("UnGlow: ^"%s<%s>^" has removed the glow from %s<%s>",AdminName,AdminAuth,VictimName,VictimAuth) } #endif public client_connect(id) { g_Players[id] = -1 }
|