Raised This Month: $32 Target: $400
 8% 

[REQ] Chat


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
rushnazy
Junior Member
Join Date: May 2018
Old 05-20-2018 , 14:57   [REQ] Chat
Reply With Quote #1

Hello, can someone help me in this code. I wanna to make for example. If someone is admin says

[Admin] [Fama: %d] [Nivel: %d] Nazy.- : hello

I mean, if the user is admin, at the start of chat appears [Admin], someone can helps?

PHP Code:
/*================================================================================
 [Client Commands]
=================================================================================*/

// Chat say
public clcmd_say(id)
{
    static 
said[89]
    
read_args(saidcharsmax(said))
    
remove_quotes(said)
    
replace_all(saidcharsmax(said), "%"" ")
    
    
// Don't say nothing
    
if (count_characters(said) < 1) return PLUGIN_HANDLED;
    
    
// Prevent chat from a player calling many times in a minute
    
static Float:chat_time[33]
    if (
get_gametime() - chat_time[id] < 2.0) return PLUGIN_HANDLED;
    
chat_time[id] = get_gametime()
    
    
// Get unblock words
    
static buffer[100]
    for (new 
0ArraySize(g_unblock_words); i++)
    {
        
ArrayGetString(g_unblock_wordsibuffercharsmax(buffer))
        if (
equal(saidbuffer)) return PLUGIN_CONTINUE;
    }
    
    
// Get his team and change the chat type and colors
    
static message[156]
    switch (
fm_cs_get_user_team(id))
    {
        case 
FM_CS_TEAM_UNASSIGNEDformatex(messagecharsmax(message), "^x01*UNASSIGNED* ^x03 %s^x01: %s"g_playername[id], said)
        case 
FM_CS_TEAM_TFM_CS_TEAM_CTformatex(messagecharsmax(message), "^x01%s[Fama:^x04 %d^x01][Nivel:^x04 %d^x01]^x03 %s^x01: %s"g_isalive[id] ? "" "DEAD"g_fame[id], g_level[id], g_playername[id], said)
        case 
FM_CS_TEAM_SPECTATORformatex(messagecharsmax(message), "^x01*SPEC* [Fama:^x04 %d^x01][Nivel:^x04 %d^x01]^x03 %s^x01: %s"g_fame[id], g_level[id], g_playername[id], said)
    }
    
    
zp_colored_print(0message)
    
    return 
PLUGIN_HANDLED;

__________________
The universe is so infinite, but not as infinite as the errors in the plugins.
rushnazy 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 19:47.


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