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

Admin login/connect sound


Post New Thread Reply   
 
Thread Tools Display Modes
hleV
Veteran Member
Join Date: Mar 2007
Location: Lithuania
Old 04-16-2009 , 11:27   Re: Admin login/connect sound
Reply With Quote #11

Fixed that + some other thing.
Code:
#include <amxmodx>   #define FLAG_ADMIN ADMIN_LEVEL_A   new g_AdminNames[][] = {         "hleV",         "pur3",         "BAILOPAN" };   new g_AdminMusic[][] = {         "sound/mp3/hlev.mp3",         "sound/mp3/pur3.mp3",         "sound/wav/bailopan.wav" };   public plugin_precache()         for (new Sound = 0; Sound < sizeof(g_AdminMusic); Sound++)                 precache_generic(g_AdminMusic[Sound]);   public plugin_init()         register_plugin("Admin Connect Music", "1.2", "hleV");   public client_authorized(Cl) {         if (!(get_user_flags(Cl) & FLAG_ADMIN)) return;         new PlayCmd[9], Name[32];         get_user_name(Cl, Name, 31);           for (new Num = 0; Num < sizeof(g_AdminNames); Num++) if (equal(Name, g_AdminNames[Num]))         {                                switch (g_AdminMusic[Num][strlen(g_AdminMusic[Num]) - 1])                 {                         case '3': PlayCmd = "mp3 play";                         case 'v': PlayCmd = "spk";                           default: break;                 }                   client_cmd(Cl, "%s ^"%s^"", PlayCmd, g_AdminMusic[Num]);                 client_cmd(0, "%s ^"%s^"", PlayCmd, g_AdminMusic[Num]);                   break;         } }
__________________
hleV is offline
pur3
Junior Member
Join Date: Apr 2009
Old 04-16-2009 , 14:10   Re: Admin login/connect sound
Reply With Quote #12

thanx man
pur3 is offline
Ramzik
Junior Member
Join Date: Jul 2009
Old 01-10-2011 , 16:23   Re: Admin login/connect sound
Reply With Quote #13

Error compiling ...
Ramzik is offline
Send a message via Skype™ to Ramzik
Diva
Member
Join Date: Aug 2012
Location: Denmark
Old 05-07-2013 , 14:12   Re: Admin login/connect sound
Reply With Quote #14

Quote:
Originally Posted by hleV View Post
I'm sure there is a plugin like that. You should have used search.

This should work.
Code:
#include <amxmodx>   #define FLAG_ADMIN ADMIN_LEVEL_A   new g_AdminMusic[] = "sound/mp3/admin.mp3";   public plugin_precache() precache_generic(g_AdminMusic);   public client_authorized(Cl) {         if (!(get_user_flags(Cl) & FLAG_ADMIN)) return;           new PlayCmd[9];           switch (g_AdminMusic[strlen(g_AdminMusic) - 1])         {                 case '3': PlayCmd = "mp3 play";                 case 'v': PlayCmd = "spk";                   default: return;         }           client_cmd(0, "%s ^"%s^"", PlayCmd, g_AdminMusic); }
flag admin a? u sure it shouldt be ADMIN_IMMUNITY
if its surposed to put it on admins with the access flag A. right.. ?
Diva is offline
joshknifer
Veteran Member
Join Date: Jun 2011
Location: Denver, CO
Old 05-07-2013 , 14:22   Re: Admin login/connect sound
Reply With Quote #15

__________________
joshknifer is offline
Send a message via Skype™ to joshknifer
dypz
Senior Member
Join Date: Mar 2009
Location: Belarus, Orsha
Old 05-08-2013 , 12:35   Re: Admin login/connect sound
Reply With Quote #16

If i need to check steamid then i need to change get_user_name to get_user_authid, yes?
__________________


Last edited by dypz; 05-08-2013 at 12:36.
dypz is offline
Send a message via Skype™ to dypz
ajpr
Junior Member
Join Date: Sep 2018
Old 03-18-2024 , 12:04   Re: Admin login/connect sound
Reply With Quote #17

Quote:
Originally Posted by hleV View Post
Code:
#include <amxmodx>   #define FLAG_ADMIN ADMIN_LEVEL_A   new g_AdminNames[][] = {         "hleV",         "pur3",         "BAILOPAN" };   new g_AdminMusic[][] = {         "sound/mp3/hlev.mp3",         "sound/mp3/pur3.mp3",         "sound/wav/bailopan.wav" };   public plugin_precache()         for (new Sound = 0; Sound < sizeof(g_AdminMusic); Sound++)                 precache_generic(g_AdminMusic[Sound]);   public plugin_init()         register_plugin("Admin Connect Music", "1.1", "hleV");   public client_authorized(Cl) {         if (!(get_user_flags(Cl) & FLAG_ADMIN)) return;           new PlayCmd[9], Name[32];         get_user_name(Cl, Name, 31);           for (new Num = 0; Num < sizeof(g_AdminNames); Num++) if (equal(Name, g_AdminNames[Num]))         {                                switch (g_AdminMusic[Num][strlen(g_AdminMusic[Num]) - 1])                 {                         case '3': PlayCmd = "mp3 play";                         case 'v': PlayCmd = "spk";                           default: break;                 }                   client_cmd(0, "%s ^"%s^"", PlayCmd, g_AdminMusic);                   break;         } }
Hi everyone, the plugin is very good, but I found a problem, if there are three names listed in the plugin, and all three enter the server at the same time, the three songs play and generate a mixture of several sounds, the same happens if you change the map, I would like help to end this conflict of sounds.
ajpr is offline
lexzor
Veteran Member
Join Date: Nov 2020
Old 03-18-2024 , 14:12   Re: Admin login/connect sound
Reply With Quote #18

this should stop the played song:

Code:
#include <amxmodx> #if AMXX_VERSION_NUM < 183     const MAX_NAME_LENGTH = 32     const MAX_RESOURCE_PATH_LENGTH = 64 #endif #define FLAG_ADMIN ADMIN_LEVEL_A new g_AdminNames[][] = {         "hleV",         "pur3",         "BAILOPAN" };   new g_AdminMusic[][] = {         "sound/mp3/hlev.mp3",         "sound/mp3/pur3.mp3",         "sound/wav/bailopan.wav" }; new g_LastPlayedSong[MAX_RESOURCE_PATH_LENGTH];   public plugin_precache()         for (new Sound = 0; Sound < sizeof(g_AdminMusic); Sound++)                 precache_generic(g_AdminMusic[Sound]);   public plugin_init()         register_plugin("Admin Connect Music", "1.1", "hleV");   public client_authorized(Cl) {         if (!(get_user_flags(Cl) & FLAG_ADMIN)) return;         new Name[MAX_NAME_LENGTH];         get_user_name(Cl, Name, charsmax(Name));         for (new Num = 0; Num < sizeof(g_AdminNames); Num++) if (equal(Name, g_AdminNames[Num]))         {                          emit_sound(0, CHAN_AUTO, g_LastPlayedSong, VOL_NORM, ATTN_NORM, SND_STOP, PITCH_NORM);                 emit_sound(0, CHAN_AUTO, g_AdminMusic[Num], VOL_NORM, ATTN_NORM, 0, PITCH_NORM);                 copy(g_LastPlayedSong, charsmax(g_LastPlayedSong), g_AdminMusic[Num])                 break;         } }

Last edited by lexzor; 03-20-2024 at 12:01.
lexzor is offline
ajpr
Junior Member
Join Date: Sep 2018
Old 03-18-2024 , 14:46   Re: Admin login/connect sound
Reply With Quote #19

Thank you very much, I will test it on my server
ajpr is offline
ajpr
Junior Member
Join Date: Sep 2018
Old 03-18-2024 , 16:46   Re: Admin login/connect sound
Reply With Quote #20

gave compilation error

error 017: undefined symbol"MAX_RESOURSE_PATH_LENGTH error 009 :invalid array size(negative or zero) warning 224: indeterminate array size in "sizeof" expression (symbol "")
ajpr 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 12:45.


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