Raised This Month: $84 Target: $400
 21% 

No Perm No Chat Sound


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
GoGetSomeSleep
Member
Join Date: Dec 2018
Location: Miami/Florida
Old 07-24-2019 , 06:18   No Perm No Chat Sound
Reply With Quote #1

Code:
#pragma semicolon 1
//#pragma newdecls required
#include <sourcemod>
#include <sdktools>
#include <clientprefs>

#define DD	"buttons/blip1.wav"

int blocktext;
new Handle:g_isEnabled = INVALID_HANDLE;

public void OnPluginStart()
{
	g_isEnabled = CreateConVar("sm_saysound_enable", "1", "(1 = ON ; 0 = OFF)", 0);

	AddCommandListener(Command_Say, "say");
    
	blocktext = false;
}

public RemoveSymbol(char[] buffer)
{   
	char str[3];
	char new_str[3];
	int new_str_count = 0;  
	
	strcopy(str, 3, buffer);   
   
	for (int i = 0, len = 2; i <len; i++)
	{
		if (('!' == str[i]) || ('/' == str[i]))
		{
			new_str[new_str_count] = str[i];
			new_str_count++;
		}	
	}
	strcopy(buffer, 3, new_str); 	
}

public Action Command_Say(client, const String:command[], args)
{
    if(!g_isEnabled) return Plugin_Stop;

    if (!blocktext)
    {
		blocktext = true;
		
		char isay[3];
		if (GetCmdArgString(isay, sizeof(isay)) >= 1)
		{
			RemoveSymbol(isay);
			//PrintToChatAll("%s", isay);
			if ((isay[0] == '!')
			|| (isay[0] == '/'))			
			{
				blocktext = false;
				return Plugin_Stop;
			}
			EmitSoundToAll(DD);
		}
		CreateTimer(0.0, UnblockText);
    }
    return Plugin_Continue;
}

public Action UnblockText(Handle timer)
{
    blocktext = false;
}
this script makes a sound when people send messages to a public chat. can anyone set up only those people who have these privileges like other no perm no chat script? no perm no chatsound you know, and it would be great if there was another sound for each perm. flag.
thank you very much in advance for your help
ADMFLAG_RESERVATION | ADMFLAG_VOTE | ADMFLAG_KICK
GoGetSomeSleep is offline
Pilo
AlliedModders Donor
Join Date: Jan 2019
Location: Israel
Old 07-24-2019 , 10:08   Re: No Perm No Chat Sound
Reply With Quote #2

Just fix something
PHP Code:
public Action Command_Say(client, const String:command[], args
To
PHP Code:
public Action Command_Say(int client, const char[] commandint args
__________________

Taking Private(PAID) Plugins In PM
Feel free to Donate with PayPal
Feel free to message me in Discord Pilo#8253
Total donated : 25$

Last edited by Pilo; 07-24-2019 at 10:08.
Pilo is offline
kaiser2nd
Junior Member
Join Date: Jun 2019
Old 07-25-2019 , 16:29   Re: No Perm No Chat Sound
Reply With Quote #3

You already made a thread for this.
kaiser2nd is offline
GoGetSomeSleep
Member
Join Date: Dec 2018
Location: Miami/Florida
Old 07-25-2019 , 20:45   Re: No Perm No Chat Sound
Reply With Quote #4

Quote:
Originally Posted by kaiser2nd View Post
You already made a thread for this.
no, sorry.
GoGetSomeSleep is offline
GoGetSomeSleep
Member
Join Date: Dec 2018
Location: Miami/Florida
Old 08-23-2019 , 06:13   Re: No Perm No Chat Sound
Reply With Quote #5

anybody help pls? just modify script for non-perm users don't have a chat sound..
GoGetSomeSleep is offline
Cruze
Veteran Member
Join Date: May 2017
Old 08-23-2019 , 12:47   Re: No Perm No Chat Sound
Reply With Quote #6

PHP Code:
#pragma semicolon 1
#pragma newdecls required

#include <sourcemod>
#include <sdktools>
#include <clientprefs>

#define DD    "buttons/blip1.wav"

bool blocktext false;
Handle g_isEnabled INVALID_HANDLE;

public 
void OnPluginStart()
{
    
g_isEnabled CreateConVar("sm_saysound_enable""1""(1 = ON ; 0 = OFF)"0);

    
AddCommandListener(Command_Say"say");
    
    
blocktext false;
}

stock char RemoveSymbol(char[] buffer)
{   
    
char str[3];
    
char new_str[3];
    
int new_str_count 0;  
    
    
strcopy(str3buffer);   
   
    for (
int i 0len 2<leni++)
    {
        if ((
'!' == str[i]) || ('/' == str[i]))
        {
            
new_str[new_str_count] = str[i];
            
new_str_count++;
        }    
    }
    
strcopy(buffer3new_str);
    return 
buffer;
}

public 
Action Command_Say(int client, const char[] commandint args)  
{
    if(!
g_isEnabled) return Plugin_Stop;

    if (!
blocktext)
    {
        
blocktext true;
        
        
char isay[3];
        if (
GetCmdArgString(isaysizeof(isay)) >= 1)
        {
            
RemoveSymbol(isay);
            
//PrintToChatAll("%s", isay);
            
if ((isay[0] == '!')
            || (
isay[0] == '/'))            
            {
                
blocktext false;
                return 
Plugin_Stop;
            }
            if(
CheckCommandAccess(client""ADMFLAG_RESERVATION ADMFLAG_VOTE ADMFLAG_KICK))
                
EmitSoundToAll(DD);
        }
        
RequestFrame(UnblockText0);
    }
    return 
Plugin_Continue;
}

public 
void UnblockText(any idk)
{
    
blocktext false;

__________________
Taking paid private requests! Add me on steam!

Discord: Cruze#4947 | AlliedModders Releases | Github | Steam | PayPal
Cruze is offline
GoGetSomeSleep
Member
Join Date: Dec 2018
Location: Miami/Florida
Old 08-25-2019 , 09:16   Re: No Perm No Chat Sound
Reply With Quote #7

i will test
GoGetSomeSleep is offline
Reply


Thread Tools
Display Modes

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 01:45.


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