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

CS:GO - Welcome Chat Message


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
jolugara
New Member
Join Date: Jul 2021
Old 07-27-2021 , 13:29   CS:GO - Welcome Chat Message
Reply With Quote #1

I need a plugin to welcome the user into the chat when entering the csgo server but I don't get any, I found an old post but the name of the server there is no way to change it

https://forums.alliedmods.net/showthread.php?t=305426
jolugara is offline
SmokieCS
AlliedModders Donor
Join Date: Nov 2019
Location: Denmark
Old 07-28-2021 , 00:21   Re: CS:GO - Welcome Chat Message
Reply With Quote #2

Quote:
Originally Posted by jolugara View Post
I need a plugin to welcome the user into the chat when entering the csgo server but I don't get any, I found an old post but the name of the server there is no way to change it

https://forums.alliedmods.net/showthread.php?t=305426
You can tho edit all things in the script. I marked the print to chat things, and server convars with red.
Code:
//Sourcemod Includes
#include <sourcemod>

//Pragma
#pragma semicolon 1
#pragma newdecls required

//Globals
bool g_bMessagesShown[MAXPLAYERS + 1];

ConVar g_cServerLink;
ConVar g_cWebsiteLink;

public Plugin myinfo = 
{
	name = "Conmessage", 
	author = "Markie", 
	description = "Connect Message.", 
	version = "1.0.0", 
	url = "https://nerp.cf/"
};

public void OnPluginStart()
{
	g_cServerLink = CreateConVar("sm_cmsg_serverlink", "www.yourwebsite.com/sourcebans", "Link to your servers page");
	g_cWebsiteLink = CreateConVar("sm_cmsg_websitelink", "www.yourwebsite.com", "Link to your website");

	HookEvent("player_spawn", Event_OnPlayerSpawn);
}

public void OnMapStart()
{
	for (int i = 1; i <= MaxClients; i++)
	{
		g_bMessagesShown[i] = false;
	}
}

public void Event_OnPlayerSpawn(Event event, const char[] name, bool dontBroadcast)
{
	int client = GetClientOfUserId(GetEventInt(event, "userid"));
	
	if (client == 0 || IsFakeClient(client))
	{
		return;
	}
	
	CreateTimer(0.2, Timer_DelaySpawn, GetClientUserId(client), TIMER_FLAG_NO_MAPCHANGE);
}

public Action Timer_DelaySpawn(Handle timer, any data)
{
	int client = GetClientOfUserId(data);
	
	if (client == 0 || !IsPlayerAlive(client) || g_bMessagesShown[client])
	{
		return Plugin_Continue;
	}

	char sServerLink[128];
	char sWebsiteLink[128];

	g_cServerLink.GetString(sServerLink, sizeof(sServerLink));
	g_cWebsiteLink.GetString(sWebsiteLink, sizeof(sWebsiteLink));
	
	PrintToChat(client, "WCM \x07~ \x01Hey Ho, \x03%N", client);
	PrintToChat(client, "WCM \x07~ \x01Please Join \x06%s", client, sWebsiteLink);
	PrintToChat(client, "WCM \x07~ \x01Have Fun, Be Nice. Enjoy!", client);
	PrintToChat(client, "WCM \x07~ \x01Servers: \x06%s", client, sServerLink);
	PrintToChat(client, "WCM \x07~ \x04Update\x01: \x10Clutch Case \x01Added!", client);
	g_bMessagesShown[client] = true;
	
	return Plugin_Continue;
}

public void OnClientDisconnect(int client)
{
	g_bMessagesShown[client] = false;
}
__________________
Server Manager & Chairman of the Board - https://esportharte.dk/
Freelance Server Support
Former Co-Owner - https://tfrag.dk/

Last edited by DarkDeviL; 07-28-2021 at 11:22.
SmokieCS 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 08:14.


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