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

Need help with VIP connect


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
LaineN
Veteran Member
Join Date: Mar 2008
Location: Sweden
Old 04-12-2008 , 06:44   Need help with VIP connect
Reply With Quote #1

I want a plugin that shows when a VIP connect.
VIP is a player with ADMIN_FLAG B.
It shall show a white hud message with sound when a VIP connect.
The sound I want is "valve/sound/buttons/bell1".

Please help me... I've searh in forum but with no result.
LaineN is offline
hazard1337
Senior Member
Join Date: Sep 2006
Old 04-12-2008 , 14:48   Re: Need help with VIP connect
Reply With Quote #2

No one else post this! I got it!
__________________
[IMG]http://img139.**************/img139/1530/2sejaewg1.gif[/IMG]
If you +/- my K, leave your name.
I do not take requests VIA PM
Click on this before requesting/suggesting
This is your best friend
hazard1337 is offline
Send a message via Skype™ to hazard1337
stask0
Senior Member
Join Date: Aug 2007
Old 04-12-2008 , 14:55   Re: Need help with VIP connect
Reply With Quote #3

i can try to script that but you sayd a "white hud message" what should it says?? Vip Connected or something?
__________________
+ karma if i helped
stask0 is offline
LaineN
Veteran Member
Join Date: Mar 2008
Location: Sweden
Old 04-12-2008 , 14:59   Re: Need help with VIP connect
Reply With Quote #4

Like "VIP: LaineN has connected"
LaineN is offline
stask0
Senior Member
Join Date: Aug 2007
Old 04-12-2008 , 15:11   Re: Need help with VIP connect
Reply With Quote #5

PHP Code:
#include <amxmodx>
#include <amxmisc>

#define PLUGIN "Vip Connect"
#define VERSION "1.0"
#define AUTHOR "stask0"

public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
}

public 
plugin_precache() {
    
precache_sound("buttons/bell1.wav")
}

public 
client_putinserver(id) {
    if((
get_user_flags(id) & ADMIN_LEVEL_B)) {
    new 
name[32]
    
get_user_name(idname31)
    
set_hudmessage(255255255, -1.00.25010.010.00.80.81)
    
show_hudmessage(0"VIP: %s has joined the server!"name)
    
client_print(idprint_chat"Welcome %s."name)
    
client_cmd(id"speak buttons/bell1.wav")
    }

didnt tested it .. but it should work :d if you wannt i can add something else.. btw the directory of the .wav should be like that cstrike/sound/buttons/bell1.wav
__________________
+ karma if i helped

Last edited by stask0; 04-12-2008 at 15:16.
stask0 is offline
hazard1337
Senior Member
Join Date: Sep 2006
Old 04-12-2008 , 15:27   Re: Need help with VIP connect
Reply With Quote #6

Mine is like his but with CVARS :O

PHP Code:
#include <amxmodx>
#include <amxmisc>
 
#define PLUGIN    "VIP Connect"
#define AUTHOR    "Neo Hazard"
#define VERSION    "1.0"
 
#define ADMIN_LEVEL vip_level
 
new vip_level
new msg1[101]
new 
playername[51]
new 
p_displaymsg
 
public plugin_precache()
{
    
precache_sound("valve/sound/buttons/bell1.wav")
}
public 
client_putinserver(id)
{
    
get_user_name(idplayername50)
    
get_pcvar_string(p_displaymsgmsg1100)
    if(
ADMIN_LEVEL)
    {
    
set_hudmessage(255,0,0,-1.0,0.32,0,6.0,5.0)
    
show_hudmessage(0,msg1,playername)
    
emit_sound(0CHAN_AUTO"vavle/sound/buttons/bell1.wav"1.0ATTN_NONE0PITCH_NORM)
    }
}
public 
plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
vip_level register_cvar("vip_level","ADMIN_LEVEL_B")
    
p_displaymsg register_cvar("p_display_msg","[VIP] %s is a VIP and has joined the game!")

Cvars: p_display_msg - will display the chosen message, include %s to display the name of the VIP.
vip_level - look in amxconst.inc for the admin levels.

Edit: added sound, untested.
__________________
[IMG]http://img139.**************/img139/1530/2sejaewg1.gif[/IMG]
If you +/- my K, leave your name.
I do not take requests VIA PM
Click on this before requesting/suggesting
This is your best friend

Last edited by hazard1337; 04-14-2008 at 10:03.
hazard1337 is offline
Send a message via Skype™ to hazard1337
atomen
Veteran Member
Join Date: Oct 2006
Location: Stockholm, Sweden
Old 04-12-2008 , 16:52   Re: Need help with VIP connect
Reply With Quote #7

I also took some time to make another type of script.

Since you wanted the events to happened when the user connects
not when the user is in-game.

If you want the message to come up
when he is in-game put 2 "/" in front of "#define ON_CONNECT"
PHP Code:
#include <amxmodx>
#include <amxmisc>

#define ON_CONNECT
//#define PRINT_CHAT

#if defined ON_CONNECT
 #include <fakemeta>
#endif

new const PLUGIN_NAME[] = "VIP Connect"
new const PLUGIN_VERSION[] = "1.0"
new const PLUGIN_AUTHOR[] = "Atomen"

#define ADMIN_LEVEL ADMIN_LEVEL_B

new sound_prepcvarname[32]

#if defined PRINT_CHAT
 
new const MESSAGE[] = "^x04[VIP] ^x01%s has ^x04connected ^x01to the server"
#else
 
new const MESSAGE[] = "[VIP] %s has connected to the server"
#endif

public plugin_init()
{
    
//Register Plugin
    
register_plugin(PLUGIN_NAMEPLUGIN_VERSIONPLUGIN_AUTHOR)

    
//Register Event
    #if defined ON_CONNECT
    
register_forward(FM_ClientConnect,"FM_Client_Connect")
    
#endif
    
pcvar register_cvar("amx_vip""1")
}

public 
plugin_precache()
{
    if(
get_pcvar_num(pcvar))
        
sound_pre precache_sound("valve/sound/buttons/bell1")
}

#if defined ON_CONNECT
public FM_Client_Connect(id)
{
    if(
get_pcvar_num(pcvar))
    {
        if(
get_user_flags(id) & ADMIN_LEVEL)
        {
            
get_user_name(idname31)

            
#if defined PRINT_CHAT
             
join_print(id)
            
#else
             
set_hudmessage(255255255, -1.00.3206.05.0)
             
show_hudmessage(0MESSAGEname)
            
#endif

            
client_cmd(0"speak %s"sound_pre)
        }
    }
}

#else
public client_putinserver(id)
{
    if(
get_pcvar_num(pcvar))
    {
        if(
get_user_flags(id) & ADMIN_LEVEL)
        {
            
get_user_name(idname31)

            
#if defined PRINT_CHAT
             
join_print(id)
            
#else
             
set_hudmessage(255255255, -1.00.3206.05.0)
             
show_hudmessage(0MESSAGEname)
            
#endif

            
client_cmd(0"speak %s"sound_pre)
        }
    }
}
#endif

#if defined PRINT_CHAT
stock join_print(id, {Float,Sql,Result,_}:...)
{
    new 
finalmsg[192]
    
formatex(finalmsg191"%s"MESSAGEname[id])
    
message_begin(MSG_ALLget_user_msgid("SayText"))
    
write_byte(id)
    
write_string(finalmsg)
    
message_end()
}
#endif 
The join message is displayed as a hudmessage right now but you can remove the "//" in front of "#define PRINT_CHAT" to make the message displayed in the chat(its green, not yellow).

Just recompile then. 1 cvar, amx_vip toggles the plugin on/off

FYI it is untested
__________________

Last edited by atomen; 04-12-2008 at 16:55.
atomen is offline
Send a message via MSN to atomen
LaineN
Veteran Member
Join Date: Mar 2008
Location: Sweden
Old 04-13-2008 , 09:03   Re: Need help with VIP connect
Reply With Quote #8

Quote:
Originally Posted by atomen View Post
I also took some time to make another type of script.

Since you wanted the events to happened when the user connects
not when the user is in-game.

If you want the message to come up
when he is in-game put 2 "/" in front of "#define ON_CONNECT"
PHP Code:
#include <amxmodx>
#include <amxmisc>

#define ON_CONNECT
//#define PRINT_CHAT

#if defined ON_CONNECT
 #include <fakemeta>
#endif

new const PLUGIN_NAME[] = "VIP Connect"
new const PLUGIN_VERSION[] = "1.0"
new const PLUGIN_AUTHOR[] = "Atomen"

#define ADMIN_LEVEL ADMIN_LEVEL_B

new sound_prepcvarname[32]

#if defined PRINT_CHAT
 
new const MESSAGE[] = "^x04[VIP] ^x01%s has ^x04connected ^x01to the server"
#else
 
new const MESSAGE[] = "[VIP] %s has connected to the server"
#endif

public plugin_init()
{
    
//Register Plugin
    
register_plugin(PLUGIN_NAMEPLUGIN_VERSIONPLUGIN_AUTHOR)

    
//Register Event
    #if defined ON_CONNECT
    
register_forward(FM_ClientConnect,"FM_Client_Connect")
    
#endif
    
pcvar register_cvar("amx_vip""1")
}

public 
plugin_precache()
{
    if(
get_pcvar_num(pcvar))
        
sound_pre precache_sound("valve/sound/buttons/bell1")
}

#if defined ON_CONNECT
public FM_Client_Connect(id)
{
    if(
get_pcvar_num(pcvar))
    {
        if(
get_user_flags(id) & ADMIN_LEVEL)
        {
            
get_user_name(idname31)

            
#if defined PRINT_CHAT
             
join_print(id)
            
#else
             
set_hudmessage(255255255, -1.00.3206.05.0)
             
show_hudmessage(0MESSAGEname)
            
#endif

            
client_cmd(0"speak %s"sound_pre)
        }
    }
}

#else
public client_putinserver(id)
{
    if(
get_pcvar_num(pcvar))
    {
        if(
get_user_flags(id) & ADMIN_LEVEL)
        {
            
get_user_name(idname31)

            
#if defined PRINT_CHAT
             
join_print(id)
            
#else
             
set_hudmessage(255255255, -1.00.3206.05.0)
             
show_hudmessage(0MESSAGEname)
            
#endif

            
client_cmd(0"speak %s"sound_pre)
        }
    }
}
#endif

#if defined PRINT_CHAT
stock join_print(id, {Float,Sql,Result,_}:...)
{
    new 
finalmsg[192]
    
formatex(finalmsg191"%s"MESSAGEname[id])
    
message_begin(MSG_ALLget_user_msgid("SayText"))
    
write_byte(id)
    
write_string(finalmsg)
    
message_end()
}
#endif 
The join message is displayed as a hudmessage right now but you can remove the "//" in front of "#define PRINT_CHAT" to make the message displayed in the chat(its green, not yellow).

Just recompile then. 1 cvar, amx_vip toggles the plugin on/off

FYI it is untested
I tested it and it works half...
It comes a text with that a VIP has connected but no sound...
LaineN is offline
atomen
Veteran Member
Join Date: Oct 2006
Location: Stockholm, Sweden
Old 04-13-2008 , 10:29   Re: Need help with VIP connect
Reply With Quote #9

Try this
PHP Code:
#include <amxmodx>
#include <amxmisc>

#define ON_CONNECT
//#define PRINT_CHAT

#if defined ON_CONNECT
 #include <fakemeta>
#endif

new const PLUGIN_NAME[] = "VIP Connect"
new const PLUGIN_VERSION[] = "1.0"
new const PLUGIN_AUTHOR[] = "Atomen"

#define ADMIN_LEVEL ADMIN_LEVEL_B

new sound_prepcvarname[32]

#if defined PRINT_CHAT
 
new const MESSAGE[] = "^x04[VIP] ^x01%s has ^x04connected ^x01to the server"
#else
 
new const MESSAGE[] = "[VIP] %s has connected to the server"
#endif

public plugin_init()
{
    
//Register Plugin
    
register_plugin(PLUGIN_NAMEPLUGIN_VERSIONPLUGIN_AUTHOR)

    
//Register Event
    #if defined ON_CONNECT
    
register_forward(FM_ClientConnect,"FM_Client_Connect")
    
#endif
    
pcvar register_cvar("amx_vip""1")
}

public 
plugin_precache()
{
    if(
get_pcvar_num(pcvar))
        
sound_pre precache_sound("valve/sound/buttons/bell1.wav")
}

#if defined ON_CONNECT
public FM_Client_Connect(id)
{
    if(
get_pcvar_num(pcvar))
    {
        if(
get_user_flags(id) & ADMIN_LEVEL)
        {
            
get_user_name(idname31)

            
#if defined PRINT_CHAT
             
join_print(id)
            
#else
             
set_hudmessage(255255255, -1.00.3206.05.0)
             
show_hudmessage(0MESSAGEname)
            
#endif

            
client_cmd(0"speak %s"sound_pre)
        }
    }
}

#else
public client_putinserver(id)
{
    if(
get_pcvar_num(pcvar))
    {
        if(
get_user_flags(id) & ADMIN_LEVEL)
        {
            
get_user_name(idname31)

            
#if defined PRINT_CHAT
             
join_print(id)
            
#else
             
set_hudmessage(255255255, -1.00.3206.05.0)
             
show_hudmessage(0MESSAGEname)
            
#endif

            
client_cmd(0"speak %s"sound_pre)
        }
    }
}
#endif

#if defined PRINT_CHAT
stock join_print(id, {Float,Sql,Result,_}:...)
{
    new 
finalmsg[192]
    
formatex(finalmsg191"%s"MESSAGEname[id])
    
message_begin(MSG_ALLget_user_msgid("SayText"))
    
write_byte(id)
    
write_string(finalmsg)
    
message_end()
}
#endif 
__________________
atomen is offline
Send a message via MSN to atomen
Battousai-sama
Veteran Member
Join Date: Jul 2007
Old 04-13-2008 , 10:36   Re: Need help with VIP connect
Reply With Quote #10

Quote:
Originally Posted by hazard1337 View Post
Mine is like his but with CVARS :O
Hazard. i like urs :] but can u put sound into it (^_^)

Thanks.
__________________
Battousai-sama is offline
Send a message via MSN to Battousai-sama
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 21:07.


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