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

Need help with VIP connect


Post New Thread Reply   
 
Thread Tools Display Modes
hazard1337
Senior Member
Join Date: Sep 2006
Old 04-14-2008 , 09:50   Re: Need help with VIP connect
Reply With Quote #11

yea Ill edit the post
__________________
[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
LaineN
Veteran Member
Join Date: Mar 2008
Location: Sweden
Old 04-14-2008 , 15:48   Re: Need help with VIP connect
Reply With Quote #12

Quote:
Originally Posted by atomen View Post
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 
The sound still dont work...
LaineN is offline
LaineN
Veteran Member
Join Date: Mar 2008
Location: Sweden
Old 04-14-2008 , 15:50   Re: Need help with VIP connect
Reply With Quote #13

Quote:
Originally Posted by hazard1337 View Post
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.
Hasard..
Can you make so the text come when the VIP is connecting and not when they are in game?
And with sound..
LaineN is offline
rudle
BANNED
Join Date: Mar 2008
Location: About to be sent to bant
Old 04-14-2008 , 16:29   Re: Need help with VIP connect
Reply With Quote #14

Quote:
Originally Posted by stask0 View Post
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
stolen my vip code tut tut
rudle is offline
stask0
Senior Member
Join Date: Aug 2007
Old 04-14-2008 , 17:12   Re: Need help with VIP connect
Reply With Quote #15

ye right.. you think that it's stolen cuz i had put client_print(id, print_chat, "Welcome %s.", name) ...
__________________
+ karma if i helped
stask0 is offline
LaineN
Veteran Member
Join Date: Mar 2008
Location: Sweden
Old 04-15-2008 , 02:03   Re: Need help with VIP connect
Reply With Quote #16

Quote:
Originally Posted by stask0 View Post
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
Can you make so the text and sound comes when VIP is connecting and not when his in game?
LaineN is offline
rudle
BANNED
Join Date: Mar 2008
Location: About to be sent to bant
Old 04-15-2008 , 03:59   Re: Need help with VIP connect
Reply With Quote #17

Go there if you want the real Vip plugin
http://forums.alliedmods.net/showthr...t=69487&page=2
rudle is offline
LaineN
Veteran Member
Join Date: Mar 2008
Location: Sweden
Old 04-15-2008 , 06:05   Re: Need help with VIP connect
Reply With Quote #18

Thats not when they connect, I want that...
And I dont want to set the money and death to 1337..
I just want the text when they connect.
LaineN is offline
Old 04-15-2008, 10:00
Howdy!
This message has been deleted by Howdy!. Reason: Does not change the fact that its badly coded.
stask0
Senior Member
Join Date: Aug 2007
Old 04-15-2008 , 10:21   Re: Need help with VIP connect
Reply With Quote #19

Quote:
Originally Posted by stask0 View Post
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_connect(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
stask0 is offline
LaineN
Veteran Member
Join Date: Mar 2008
Location: Sweden
Old 04-20-2008 , 03:06   Re: Need help with VIP connect
Reply With Quote #20

Doesn't work.
No text is coming up and no sound?
No welcome message comes...
Nothing works
LaineN 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 04:23.


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