View Single Post
Ilusion9
Veteran Member
Join Date: Jun 2018
Location: Romania
Old 10-05-2019 , 10:20   Re: Simple message on user connect help
Reply With Quote #2

PHP Code:

#include <sourcemod>

public void OnClientPostAdminCheck(int client)
{
    if (!
IsFakeClient(client)) // skip bots
    
{
        
CreateTimer(5.0Timer_ConnectMessageGetClientUserId(client), TIMER_FLAG_NO_MAPCHANGE);
    }
}

public 
Action Timer_ConnectMessage(Handle timerany data)
{
    
int client GetClientOfUserId(view_as<int>(data));

    if (
client)
    {
        
char authid[65];
        if (
GetClientAuthId(clientAuthId_Steam2authidsizeof(authid))) // if has valid steam id
        
{
            
PrintToChatAll("\x01[SM] \x04%N\x01 (\x05%s\x01) has joined."clientauthid);
        }
        else
        {
            
// maybe show the message wihout his steamid ???
        
}
    }

__________________

Last edited by Ilusion9; 10-05-2019 at 10:22.
Ilusion9 is offline