Raised This Month: $ Target: $400
 0% 

Player connect


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Bladell
Senior Member
Join Date: Jun 2012
Old 07-17-2013 , 12:58   Player connect
Reply With Quote #1

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

#define PLUGIN "Vip Connect" 
#define VERSION "1.0" 
#define AUTHOR "Bladell" 
#define V1 "VIP I"
#define V2 "VIP II"
#define V3 "VIP III"
#define V4 "VIP IV"
#define V5 "VIP I, VIP II"
#define V6 "VIP I, VIP III"
#define V7 "VIP I, VIP IV"
#define V8 "VIP II, VIP III"
#define V9 "VIP II, VIP IV"
#define V10 "VIP III, VIP IV"
#define V11 "VIP I, VIP II, VIP III"
#define V12 "VIP I, VIP II, VIP IV"
#define V13 "VIP I, VIP III, VIP IV"
#define V14 "VIP II, VIP III, VIP IV"
#define V15 "all VIPs"

new g_iMsgSayText

public plugin_init()

    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_event("HLTV""message""a""1=0""2=0"
    
g_iMsgSayText get_user_msgid"SayText" );    


public 
message(id
{
    new 
pid
    
new playerCount
    
new players[SH_MAXSLOTS]
    
get_players(playersplayerCount)
    new 
name[32
    
get_user_name(idname31
    
    for ( new 
0playerCountx++ ) 
    {
        
pid players[x]
    }
    
    new 
level sh_get_user_lvl(pid)
    static 
nums;
    
get_players(playersnums);
    
    if( (
get_user_flags(id) & ADMIN_LEVEL_B) ) 
    { 
        
ChatColor(0"^4[VIP]^1 %s with %s and level %d has joined the server"nameV3level);
    } 
    if( (
get_user_flags(id) & ADMIN_LEVEL_C) ) 
    {
        
ChatColor(0"^4[VIP]^1 %s with %s and level %d has joined the server"nameV2level);
    }
    if( (
get_user_flags(id) & ADMIN_LEVEL_D) )
    {
        
ChatColor(0"^4[VIP]^1 %s with %s and level %d has joined the server"nameV1level);
    }
    if( (
get_user_flags(id) & ADMIN_LEVEL_E) ) 
    {
        
ChatColor(0"^4[VIP]^1 %s with %s and level %d has joined the server"nameV4level);
    }
    if( (
get_user_flags(id) & ADMIN_LEVEL_B ADMIN_LEVEL_C 
    {
        
ChatColor(0"^4[VIP]^1 %s with %s and level %d has joined the server"nameV8level);
    }
    if( (
get_user_flags(id) & ADMIN_LEVEL_B ADMIN_LEVEL_D )
    {    
        
ChatColor(0"^4[VIP]^1 %s with %s and level %d has joined the server"nameV6level);
    }
    if( (
get_user_flags(id) & ADMIN_LEVEL_B ADMIN_LEVEL_E )
    {
        
ChatColor(0"^4[VIP]^1 %s with %s and level %d has joined the server"nameV10level);
    }
    if( (
get_user_flags(id) & ADMIN_LEVEL_C ADMIN_LEVEL_D )
    {
        
ChatColor(0"^4[VIP]^1 %s with %s and level %d has joined the server"nameV5level);
    }
    if( (
get_user_flags(id) & ADMIN_LEVEL_C ADMIN_LEVEL_E )
    {
        
ChatColor(0"^4[VIP]^1 %s with %s and level %d has joined the server"nameV9level);
    }
    if( (
get_user_flags(id) & ADMIN_LEVEL_D ADMIN_LEVEL_E )
    {
        
ChatColor(0"^4[VIP]^1 %s with %s and level %d has joined the server"nameV7level);
    }
    if( (
get_user_flags(id) & ADMIN_LEVEL_B ADMIN_LEVEL_C ADMIN_LEVEL_D )
    {
        
ChatColor(0"^4[VIP]^1 %s with %s and level %d has joined the server"nameV11level);
    }
    if( (
get_user_flags(id) & ADMIN_LEVEL_B ADMIN_LEVEL_C ADMIN_LEVEL_E )
    {
        
ChatColor(0"^4[VIP]^1 %s with %s and level %d has joined the server"nameV13level);
    }
    if( (
get_user_flags(id) & ADMIN_LEVEL_B ADMIN_LEVEL_D ADMIN_LEVEL_E )
    {
        
ChatColor(0"^4[VIP]^1 %s with %s and level %d has joined the server"nameV14level);
    }
    if( (
get_user_flags(id) & ADMIN_LEVEL_C ADMIN_LEVEL_D ADMIN_LEVEL_E )
    {
        
ChatColor(0"^4[VIP]^1 %s with %s and level %d has joined the server"nameV12level);
    }
    if( (
get_user_flags(id) & ADMIN_LEVEL_B ADMIN_LEVEL_C ADMIN_LEVEL_D ADMIN_LEVEL_E )
    {
        
ChatColor(0"^4[VIP]^1 %s with %s and level %d has joined the server"nameV15level);
    }
}  


/*-----------------------------------------------------------------------------------*/
stock ChatColor(const id, const input[], any:...)
{
    new 
count 1players[32]
    static 
msg[191]
    
vformat(msg190input3)
    
    
replace_all(msg190"!g""^4")
    
replace_all(msg190"!y""^1")
    
replace_all(msg190"!team""^3")

    
    if (
idplayers[0] = id; else get_players(playerscount"ch")
    {
        for (new 
0counti++)
        {
            if (
is_user_connected(players[i]))
            {
            
message_begin(MSG_ONE_UNRELIABLEg_iMsgSayText_players[i])  
            
write_byte(players[i]);
            
write_string(msg);
            
message_end();
            }
        }
    }

I want when a VIP connect on server with specific flag to appear a message.But I have a problem when I need to check multiple flags, please help...
Bladell is offline
 


Thread Tools
Display Modes

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 06:31.


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