plugins/basechat.sp
changeset 2899 7f1410a31503
parent 2898 b042cca3960e
child 3849 a0a045ca6d6a
     1.1 --- a/plugins/basechat.sp	Sun Jan 10 17:51:24 2010 -0800
     1.2 +++ b/plugins/basechat.sp	Sun Jan 10 17:57:34 2010 -0800
     1.3 @@ -109,9 +109,6 @@
     1.4  	decl String:message[192];
     1.5  	strcopy(message, 192, text[startidx+msgStart]);
     1.6  	
     1.7 -	decl String:name[64];
     1.8 -	GetClientName(client, name, sizeof(name));
     1.9 -	
    1.10  	if (msgStart == 1 && CheckCommandAccess(client, "sm_say", ADMFLAG_CHAT)) // sm_say alias
    1.11  	{
    1.12  		SendChatToAll(client, message);
    1.13 @@ -131,12 +128,9 @@
    1.14  		
    1.15  		if (target == -1 || len == -1)
    1.16  			return Plugin_Handled;
    1.17 -		
    1.18 -		decl String:name2[64];
    1.19 -		GetClientName(target, name2, sizeof(name2));
    1.20  	
    1.21 -		PrintToChat(client, "\x04(Private to %s) %s: \x01%s", name2, name, message[len]);
    1.22 -		PrintToChat(target, "\x04(Private to %s) %s: \x01%s", name2, name, message[len]);
    1.23 +		PrintToChat(client, "\x04(Private to %N) %N: \x01%s", target, client, message[len]);
    1.24 +		PrintToChat(target, "\x04(Private to %N) %N: \x01%s", target, client, message[len]);
    1.25  
    1.26  		LogAction(client, -1, "\"%L\" triggered sm_psay to \"%L\" (text %s)", client, target, message);		
    1.27  	}
    1.28 @@ -253,9 +247,6 @@
    1.29  	GetCmdArgString(text, sizeof(text));
    1.30  	
    1.31  	new len = BreakString(text, colorStr, 16);
    1.32 - 
    1.33 -	decl String:name[64];
    1.34 -	GetClientName(client, name, sizeof(name));
    1.35  		
    1.36  	new color = FindColor(colorStr);
    1.37  	new String:nameBuf[MAX_NAME_LENGTH];
    1.38 @@ -317,7 +308,7 @@
    1.39  	if (target == -1)
    1.40  		return Plugin_Handled;	
    1.41  		
    1.42 -	decl String:name[64], String:name2[64];
    1.43 +	decl String:name[64];
    1.44  
    1.45  	if (client == 0)
    1.46  	{
    1.47 @@ -328,18 +319,16 @@
    1.48  		GetClientName(client, name, sizeof(name));
    1.49  	}
    1.50  
    1.51 -	GetClientName(target, name2, sizeof(name2));
    1.52 -
    1.53  	if (client == 0)
    1.54  	{
    1.55 -		PrintToServer("(Private: %s) %s: %s", name2, name, message);
    1.56 +		PrintToServer("(Private: %N) %s: %s", target, name, message);
    1.57  	}
    1.58  	else
    1.59  	{
    1.60 -		PrintToChat(client, "\x04(Private: %s) %s: \x01%s", name2, name, message);
    1.61 +		PrintToChat(client, "\x04(Private: %N) %s: \x01%s", target, name, message);
    1.62  	}
    1.63  
    1.64 -	PrintToChat(target, "\x04(Private: %s) %s: \x01%s", name2, name, message);
    1.65 +	PrintToChat(target, "\x04(Private: %N) %s: \x01%s", target, name, message);
    1.66  	LogAction(client, -1, "\"%L\" triggered sm_psay to \"%L\" (text %s)", client, target, message);
    1.67  	
    1.68  	return Plugin_Handled;	
    1.69 @@ -356,10 +345,7 @@
    1.70  	decl String:text[192];
    1.71  	GetCmdArgString(text, sizeof(text));
    1.72  
    1.73 -	decl String:name[64];
    1.74 -	GetClientName(client, name, sizeof(name));
    1.75 -		
    1.76 -	SendPanelToAll(name, text);
    1.77 +	SendPanelToAll(client, text);
    1.78  
    1.79  	LogAction(client, -1, "\"%L\" triggered sm_msay (text %s)", client, text);
    1.80  	
    1.81 @@ -435,10 +421,10 @@
    1.82  	CloseHandle(kv);	
    1.83  }
    1.84  
    1.85 -SendPanelToAll(String:name[], String:message[])
    1.86 +SendPanelToAll(from, String:message[])
    1.87  {
    1.88  	decl String:title[100];
    1.89 -	Format(title, 64, "%s:", name);
    1.90 +	Format(title, 64, "%N:", from);
    1.91  	
    1.92  	ReplaceString(message, 192, "\\n", "\n");
    1.93