AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Connect (https://forums.alliedmods.net/showthread.php?t=121008)

Crazybeer 03-10-2010 14:20

Connect
 
Hello,

Can someone make a plugin like this?

When someone connect it will count how many times he have connected like this


[Crazy-Gaming] Crazybeer (STEAM_0:1:13424319) has connected. [Connections: 0]


[Crazy-Gaming] Glorian (STEAM_0:1:13424319) has disconnected.

[Crazy-Gaming] = Green color

Name = Yellow

STEAM_0:1:13424319 = Red color

() = Yellow

has disconnected/connected = Yellow.

[Connections: 0] = Green color the [] too.

When u made this plugin can u send it private to me?

BunnYboii 03-10-2010 17:31

Re: Connect
 
There is such plugins in the forum. Use the search tool, search for connect messages.

AntiBots 03-10-2010 18:10

Re: Connect
 
HERE

Seta00 03-10-2010 21:40

Re: Connect
 
Here ya go:
PHP Code:

#include <amxmodx>
#include <nvault>

#define len(%1) sizeof(%1)-1

#define PLUGIN    "Connect Messages"
#define AUTHOR    "Seta00"
#define VERSION    "1.0"

new vaultid;

public 
plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR);
    
vaultid nvault_open("connect_messages");
}

public 
plugin_end() {
    
nvault_close(vaultid);
}

public 
client_authorized(id) {
    new 
authid[32], value[10], timestampname[32], connections 0;
    
get_user_authid(idauthidlen(authid));
    
get_user_name(idnamelen(name));
    
    if (!
nvault_lookup(vaultidauthidvaluelen(value), timestamp)) {
        
nvault_set(vaultidauthid"1");
    } else {
        
connections str_to_num(value);
        
num_to_str(++connectionsvaluelen(value));
        
nvault_set(vaultidauthidvalue);
    }
    
    
ChatColor(id"!g[Connect-Messages] !y%s (!team%s!y) has connected. !g[Connections: %d]"nameauthidconnections);
    return 
PLUGIN_HANDLED;
}

public 
client_disconnect(id) {
    new 
authid[32], name[32];
    
get_user_authid(idauthidlen(authid));
    
get_user_name(idnamelen(name));
    
    
ChatColor(id"!g[Connect-Messages] !y%s (!team%s!y) has disconnected."nameauthid);
    return 
PLUGIN_HANDLED;
}

stock ChatColor(const id, const input[], any:...) {
    new 
count 1players[32]
    static 
msg[191]
    
vformat(msg190input3)
    
    
replace_all(msg190"!g""^4"// Green Color
    
replace_all(msg190"!y""^1"// Default Color
    
replace_all(msg190"!team""^3"// Team Color
    //replace_all(msg, 190, "!team2", "^0") // Team2 Color // ^0 ? WTF?!
    
    
if (idplayers[0] = id; else get_players(playerscount"ch")
    {
        for (new 
0counti++)
        {
            if (
is_user_connected(players[i]))
            {
                
message_begin(MSG_ONE_UNRELIABLEget_user_msgid("SayText"), _players[i])
                
write_byte(players[i]);
                
write_string(msg);
                
message_end();
            }
        }
    }


No, there's no "private send" concept in my mind.

EDIT: But you can't send red text to CTs, so the Steam ID will appear red for Ts and blue for CTs.

Crazybeer 03-10-2010 23:59

Re: Connect
 
Thansk dude!

JaGareN 03-11-2010 09:29

Re: Connect
 
Hej Glorian :)


All times are GMT -4. The time now is 08:37.

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