Raised This Month: $ Target: $400
 0% 

Solved Need help with chat.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Siudzix
Junior Member
Join Date: Jul 2014
Old 03-10-2018 , 10:08   Need help with chat.
Reply With Quote #1

My code is not working - messages are not showing up. Can somebody help me ?

PHP Code:
public Action:Command_SendToAll(clientargs)
{
    if((
IsPlayerGenericAdmin(client)) && GetConVarBool(tagczat))
    {    
        new 
String:text[256];
        
GetCmdArg(1textsizeof(text));
        if(
text[0] == '/' || text[0] == '@' || text[0] == '!' || text[0] == || IsChatTrigger())
        {
        return 
Plugin_Handled;
        }
        for(new 
1<= MaxClientsi++)
        {
            if(
IsClientInGame(i) && IsClientConnected(i))
            {
                if(
GetClientTeam(client) == GetClientTeam(i))
                {
                    if(
IsPlayerAlive(client) && GetClientTeam(client) != 1)
                    {
                        if(
CheckCommandAccess(client"sm_ban"ADMFLAG_BAN))
                        {
                            
PrintToChatAll("[A]%N: %s"clienttext);
                        } else {
                            
PrintToChatAll("[V]%N: %s"clienttext);
                        }
                    } else if(!
IsPlayerAlive(client) && GetClientTeam(client) != 1)
                    {
                        if(
CheckCommandAccess(client"sm_ban"ADMFLAG_BAN))
                        {
                            
PrintToChat(i,"DEAD [A]%N: %s"clienttext);
                        } else {
                            
PrintToChat(i,"DEAD [V]%N: %s"clienttext);
                        }
                    } else if(!
IsPlayerAlive(client) && GetClientTeam(client) == 1)
                    {
                        if(
CheckCommandAccess(client"sm_ban"ADMFLAG_BAN))
                        {
                            
PrintToChat(i"SPECT [A]%N: %s"clienttext);
                            return 
Plugin_Handled;
                        } else {
                            
PrintToChat(i"SPECT [V]%N: %s"clienttext);
                            return 
Plugin_Handled;
                        }
                    }
                    return 
Plugin_Handled;
                }
                return 
Plugin_Handled;
            }
            return 
Plugin_Handled;
        }
    }
    return 
Plugin_Continue;

I wanna :
1. Alive players can send messages to all players (alive+dead+spect) and can only see messages from alive players
2. Dead players can send messages to deads and spects.
3. Spects can send messages to dead and spects.

I think that my IF is good. Something is wrong with [i] and (client).

It's part of my code that hook "say". My other part that hook "say_team" is working well.

Last edited by Siudzix; 03-10-2018 at 11:59.
Siudzix is offline
Siudzix
Junior Member
Join Date: Jul 2014
Old 03-10-2018 , 11:59   Re: Need help with chat.
Reply With Quote #2

nvm, too much "return Plugin_Handled"...
Siudzix 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 10:23.


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