ConnectAnnounceNewPlayers: Update
Fix Typo in Private Message + One Plugin for all 3 Servers
This commit is contained in:
parent
eda44ca933
commit
64945e21d2
@ -5,6 +5,9 @@
|
||||
|
||||
bool g_bNewPlayer[MAXPLAYERS + 1] = { false, ... };
|
||||
|
||||
ConVar g_cvServerType;
|
||||
char g_cServerMessage[128];
|
||||
|
||||
Database g_hDatabase;
|
||||
|
||||
public Plugin myinfo =
|
||||
@ -12,13 +15,43 @@ public Plugin myinfo =
|
||||
name = "ConnectAnnounceNewPlayers",
|
||||
author = "Dogan",
|
||||
description = "Connect Announcer for new Players",
|
||||
version = "1.0.0",
|
||||
version = "1.1.0",
|
||||
url = ""
|
||||
}
|
||||
|
||||
public void OnPluginStart()
|
||||
{
|
||||
Database.Connect(SQL_OnDatabaseConnect, "unloze_newplayers");
|
||||
|
||||
g_cvServerType = CreateConVar("sm_server_type", "1", "Server related private message for new players: 1 = ze; 2 = mg; 3 = zr; any other value = neutral");
|
||||
|
||||
AutoExecConfig(true, "plugin.ConnectAnnounceNewPlayers");
|
||||
GetConVars();
|
||||
}
|
||||
|
||||
public void GetConVars()
|
||||
{
|
||||
if(g_cvServerType.IntValue == 1)
|
||||
{
|
||||
g_cServerMessage = "Zombie Escape";
|
||||
}
|
||||
else if(g_cvServerType.IntValue == 2)
|
||||
{
|
||||
g_cServerMessage = "Minigames";
|
||||
}
|
||||
else if(g_cvServerType.IntValue == 3)
|
||||
{
|
||||
g_cServerMessage = "Zombie Riot";
|
||||
}
|
||||
else
|
||||
{
|
||||
g_cServerMessage = "";
|
||||
}
|
||||
}
|
||||
|
||||
public void ConVarChange(ConVar convar, char[] oldValue, char[] newValue)
|
||||
{
|
||||
GetConVars();
|
||||
}
|
||||
|
||||
public void OnClientPostAdminCheck(int client)
|
||||
@ -90,8 +123,15 @@ public Action NewPlayerMessage(int client)
|
||||
char sName[128];
|
||||
GetClientName(client, sName, sizeof(sName));
|
||||
|
||||
CPrintToChatAll("{cyan}Player {midnightblue}%s {cyan}has just connected an UNLOZE Server for the first time! Welcome!", sName);
|
||||
CPrintToChat(client, "{cyan}Hi %s. Welcome to the {midnightblue}Unloze Zombie Escape Server{cyan}! We hope you enjoy your stay here and add our server to your favorites. Make sure to check out our website at {midnightblue}www.unloze.com{cyan}.", sName);
|
||||
CPrintToChatAll("{cyan}Player {midnightblue}%s {cyan}has just connected to an UNLOZE Server for the first time! Welcome!", sName);
|
||||
if(g_cvServerType.IntValue >= 1 && g_cvServerType.IntValue <= 3)
|
||||
{
|
||||
CPrintToChat(client, "{cyan}Hi %s. Welcome to the {midnightblue}Unloze %s Server{cyan}! We hope you enjoy your stay here and add our server to your favorites. Make sure to check out our website at {midnightblue}www.unloze.com{cyan}.", sName, g_cServerMessage);
|
||||
}
|
||||
else
|
||||
{
|
||||
CPrintToChat(client, "{cyan}Hi %s. Welcome to this {midnightblue}Unloze Server{cyan}! We hope you enjoy your stay here and add our server to your favorites. Make sure to check out our website at {midnightblue}www.unloze.com{cyan}.", sName);
|
||||
}
|
||||
}
|
||||
|
||||
public void OnClientDisconnect(int client)
|
||||
|
Loading…
Reference in New Issue
Block a user