Switched to hinttext native and added sm_hsay back to non-CSS mods. Color is still CSS only.
authorMichael McKoy <ferret99gt@gmail.com>
Wed Aug 08 21:32:39 2007 +0000 (2007-08-08)
changeset 12773645f873e752
parent 1276 501613e0859f
child 1278 4649c6a8f453
Switched to hinttext native and added sm_hsay back to non-CSS mods. Color is still CSS only.
plugins/basechat.sp
     1.1 --- a/plugins/basechat.sp	Wed Aug 08 21:32:06 2007 +0000
     1.2 +++ b/plugins/basechat.sp	Wed Aug 08 21:32:39 2007 +0000
     1.3 @@ -41,10 +41,6 @@
     1.4  
     1.5  new bool:g_DoColor = false;
     1.6  
     1.7 -#if 0
     1.8 -new g_INS = false;
     1.9 -#endif
    1.10 -
    1.11  public OnPluginStart()
    1.12  {
    1.13  	LoadTranslations("common.phrases");
    1.14 @@ -56,7 +52,7 @@
    1.15  	RegConsoleCmd("say_team", Command_SayAdmin);		
    1.16  	RegAdminCmd("sm_say", Command_SmSay, ADMFLAG_CHAT, "sm_say <message> - sends message to all players");
    1.17  	RegAdminCmd("sm_csay", Command_SmCsay, ADMFLAG_CHAT, "sm_csay <message> - sends centered message to all players");
    1.18 -	//RegAdminCmd("sm_hsay", Command_SmHsay, ADMFLAG_CHAT, "sm_hsay <message> - sends hint message to all players");
    1.19 +	RegAdminCmd("sm_hsay", Command_SmHsay, ADMFLAG_CHAT, "sm_hsay <message> - sends hint message to all players");
    1.20  	RegAdminCmd("sm_tsay", Command_SmTsay, ADMFLAG_CHAT, "sm_tsay [color] <message> - sends top-left message to all players");
    1.21  	RegAdminCmd("sm_chat", Command_SmChat, ADMFLAG_CHAT, "sm_chat <message> - sends message to admins");
    1.22  	RegAdminCmd("sm_psay", Command_SmPsay, ADMFLAG_CHAT, "sm_psay <name or #userid> <message> - sends private message");
    1.23 @@ -68,16 +64,7 @@
    1.24  	if (strcmp(modname, "cstrike") == 0)
    1.25  	{
    1.26  		g_DoColor = true;
    1.27 -		RegAdminCmd("sm_hsay", Command_SmHsay, ADMFLAG_CHAT, "sm_hsay <message> - sends hint message to all players");
    1.28  	}
    1.29 -	
    1.30 -	#if 0
    1.31 -	if (strcmp(modname, "ins") == 0)
    1.32 -	{
    1.33 -		RegConsoleCmd("say2", Command_SayChat);
    1.34 -		g_INS = true;
    1.35 -	}
    1.36 -	#endif
    1.37  }
    1.38  
    1.39  public Action:Command_SayChat(client, args)
    1.40 @@ -92,13 +79,6 @@
    1.41  		startidx = 1;
    1.42  	}
    1.43  	
    1.44 -	#if 0
    1.45 -	if (g_INS)
    1.46 -	{
    1.47 -		startidx += 4;
    1.48 -	}
    1.49 -	#endif
    1.50 -	
    1.51  	if (text[startidx] != '@')
    1.52  		return Plugin_Continue;
    1.53  	
    1.54 @@ -175,13 +155,6 @@
    1.55  		startidx = 1;
    1.56  	}
    1.57  	
    1.58 -	#if 0
    1.59 -	if (g_INS)
    1.60 -	{
    1.61 -		startidx += 4;
    1.62 -	}
    1.63 -	#endif	
    1.64 -	
    1.65  	if (text[startidx] != '@')
    1.66  		return Plugin_Continue;
    1.67  	
    1.68 @@ -251,7 +224,7 @@
    1.69  	decl String:name[64];
    1.70  	GetClientName(client, name, sizeof(name));
    1.71      
    1.72 -	SendHintToAll("%s: %s", name, text);
    1.73 +	PrintHintTextToAll("%s: %s", name, text);
    1.74  	LogMessage("%L triggered sm_hsay (text %s)", client, text);
    1.75      
    1.76  	return Plugin_Handled;    
    1.77 @@ -423,51 +396,6 @@
    1.78  	}
    1.79  }
    1.80  
    1.81 -SendHintToAll(String:text[], any:...)
    1.82 -{
    1.83 -	new String:message[192];
    1.84 -	VFormat(message, 191, text, 2);
    1.85 - 
    1.86 -	new iLen = strlen(message);
    1.87 -    
    1.88 -	if (iLen > 30)
    1.89 -	{
    1.90 -		new iLastAdded = 0;
    1.91 - 
    1.92 -		for (new i = 0; i < iLen; i++)
    1.93 -		{
    1.94 -			if((message[i] == ' ' && iLastAdded > 30 && (iLen - i) > 10) || ((GetNextSpaceCount(text, i + 1) + iLastAdded)  > 34))
    1.95 -			{
    1.96 -				message[i] = '\n';
    1.97 -				iLastAdded = 0;
    1.98 -			}
    1.99 -			else
   1.100 -				iLastAdded++;
   1.101 -		}
   1.102 -	}
   1.103 - 
   1.104 -	new Handle:hHintMessage = StartMessageAll("HintText");
   1.105 -	BfWriteByte(hHintMessage, -1);
   1.106 -	BfWriteString(hHintMessage, message);
   1.107 -	EndMessage();
   1.108 -}
   1.109 - 
   1.110 -GetNextSpaceCount(String:text[], iCurIndex)
   1.111 -{
   1.112 -	new iCount = 0;
   1.113 -	new iLen = strlen(text);
   1.114 -	
   1.115 -	for (new i = iCurIndex; i < iLen; i++)
   1.116 -	{
   1.117 -		if (text[i] == ' ')
   1.118 -			return iCount;
   1.119 -		else
   1.120 -			iCount++;
   1.121 -	}
   1.122 - 
   1.123 -	return iCount;
   1.124 -} 
   1.125 -
   1.126  SendDialogToAll(color = 0, String:text[], any:...)
   1.127  {
   1.128  	new String:message[100];